[futurebasic] Re: [FB] Embeded LONG IFs

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

From: "Michael Evans" <mikonic@...>
Date: Mon, 18 Oct 1999 13:55:54 -0400
> 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@...>
>

Sylvain:

What about:

okToGo% = 0
 LONG IF...
  okToGo% = okToGo% + 1
 XELSE
  deepDooDoo% = _condition1failed
 END IF

 LONG IF...
  okToGo% = okToGo% + 1
 XELSE
  deepDooDoo% = _condition2failed
 END IF

 LONG IF...
  okToGo% = okToGo% + 1
 XELSE
  deepDooDoo% = _condition3failed
 END IF

 LONG IF okToGo% = 3
 ' all conditions met, do your stuff
 XELSE
 'at least one condition failed....
 'pass the value of deepDooDoo% to an error handling routine...
 END IF

Cheers,

----------------------------------------------------------
Michael Evans
Manager of Software Development * Photo Systems, Inc.
3301 Wood Valley Road, NW * Atlanta, GA, 30327-1515
Voice: (404) 846-9386
Fax: (404) 240-0878 * Cell: (404) 229-3930
E-mail: evans@... * michael_evans@...
----------------------------------------------------------