[futurebasic] Re: [FB] Embeded LONG IFs

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Paul Bruneau <paul_bruneau@...>
Date: Tue, 19 Oct 1999 08:37:45 -0400
Hi, Sylvain-

Personally, ever since I have had the luxurious combination of a modular
environment that was based in a language that I was fluent in
(FutureBasic), I have been celebrating that I would never have to use
GOTO again. Please don't go there.

If the structure is truly as you have outlined below, where only the
statements in the deepest part of the structure are performed, how about

LONG IF <this> AND <that> AND <the other thing> AND <etc.>
  <stuff that gets done if it's all true>
END IF

If instead of what you wrote, your structure is actually this:

LONG IF...
  LONG IF...
    LONG IF...
      LONG IF
      And a lot more !
      END IF
    <do some stuff here>
    END IF
  <do some more stuff here>
  END IF
<do even more stuff here>
END IF

Then I think you are doing it just right. In this case, you are doing
things depending on how many of your things are true. As was mentioned,
a CASE may be able to make this easier, but possibly not, depending on
the logic of what you are trying to do, I think.

PB


Sylvain Guillemette wrote:
> 
> Hi,
> 
> In my latest app, i'm facing a problem;
> 
> I have a lot of conditional, embeded LONG IFs
> LONG IF...
>   LONG IF...
>     LONG IF...
>       LONG IF
>       And a lot more !
>       END IF
>     END IF
>   END IF
> END IF
> 
> Would it be better to just use
> IF... THEN GOTO "myLabel" ?
> "myLabel"
> 
> This way, i eliminate the need for a lot of embeded LONG IFs.
> 
> What do you guys and gals are doing in this situation ?
> 
> Thanks!
> Sylvain
> 
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>