1. Re: Short Circuiting

>Boom! As soon as a length < 3 comes along, the code crashes. So it's
>modified to:
>
>   if  length( s ) > 2 then
>      if compare( s[1..3], "EOF" ) = 0 then
>         ...
>      end if
>   else
>      ...
>   end if
>
>Only now, I'm stuck not being able to get to the 'else' portion of the
>logic. Grrr...

try:

   if  length( s ) > 2 then
      if compare( s[1..3], "EOF" ) = 0 then
         ...
      else
         ...
        end if
   end if


all you're doing is putting your original code inside an if to ensure it's
only run under certein conditions


I do fall against short-circuiting of existing commands.  If you must add
this feature, I'd recommend adding new keywords for short-circuited "and"
and "or"

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu