2 Replies Latest reply on Nov 8, 2012 7:29 AM by petermontague1

Default result in an if calculation

I want to avoid downloading a blank .gif because it replaces photos I have taken of my books. But I want to be able to download the photos if they are available. So I set up this if calculation: the first parameter works out for me returning me a blank when I get this .gif. But it is not returning the default result. I don't know why.

Any ideas?

If ( Let ( [ T = this::Child Source Code ;

end = Position ( T ; "id="original-main-image"" ; 1 ; 1 ) ;

start = Position ( T ; "<img src="" ; end ; -1 )

];

Trim ( Middle ( T ; start + 10 ; end - start - 25 ) )

) &

Parse ( this::Child Source Code ; "registerImage("original_image", "" ; "","<a href="+'"'+"" ; 1 ) = "http://g-ecx.images-amazon.com/images/G/02/nav2/dp/no-image-no-ciu._V192200227_AA300_.gif"

;

""

;

If ( Let ( [ T = this::Child Source Code ;

end = Position ( T ; "id="original-main-image"" ; 1 ; 1 ) ;

start = Position ( T ; "<img src="" ; end ; -1 )

];

Trim ( Middle ( T ; start + 10 ; end - start - 25 ) )

) &

Parse ( this::Child Source Code ; "registerImage("original_image", "" ; "","<a href="+'"'+"" ; 1 ) )

• 1. Re: Default result in an if calculation

Does the first argument of your If statement return a 0 or a non-zero numeric result or a Boolean (True/Flase) result?

Let ( [ T = this::Child Source Code ;

end = Position ( T ; "id=\"original-main-image\"" ; 1 ; 1 ) ;

start = Position ( T ; "<img src=\"" ; end ; -1 )

];

Trim ( Middle ( T ; start + 10 ; end - start - 25 ) )

) &

Parse ( this::Child Source Code ; "registerImage(\"original_image\", \"" ; "\",\"<a href=\"+'\"'+\"" ; 1 )  = "http://g-ecx.images-amazon.com/images/G/02/nav2/dp/no-image-no-ciu._V192200227_AA300_.gif"

• 2. Re: Default result in an if calculation

Actually It is working fine. My mistake! Thanks for your help.