Peter-
Variation on Evan's suggestion...
Sometimes you want to stop checking once any condition is false (or true, as the case may be). The case statement will do that. Sometimes you have to take some action depending on the condition, in which case your nested IFs would be correct. Sometimes you want to know all the things that are wrong, so you might want to check all conditions. In which case, I do something like the following:
LOCAL llFieldOK, llFileExists, llProcessedOK
llFieldOK = {SomeCondition1}
llFileExists = {SomeCondition2}
llProcessedOK = {SomeCondition3}
IF !llFieldOK
ENDI
IF !llFileExists
ENDIF
IF !llProcessedOK
ENDIF
RETURN llFieldOK .AND. llFileExists .AND. llProcessedOK
>I am writing a procedure that requires a certain set of criteria to happen before the end of the code can process. I need to know, other than a huge set of nested IF ENDIF calls, is there away to jump out of the code.
>
>Here is an example.
>
>In the CLICK method for a button that is labeled NEXT... when the user clicks on the NEXT button, it needs to process some information. If any of it fails it needs to remain on the current form after displaying an error msg. Writing this with IF's would look something like this.
>
>IF - verify proper field data is ok
> ** data OK
> IF - verify file exists
> ** file exists
> IF - processed info created
> ** processed complete
> IF - remaining criteria met
> ** all done
> ** thisform.release
> ELSE
> ** display error
> ENDIF
> ELSE
> ** display error
> ENDIF
> ELSE
> ** display error
> ENDIF
>ELSE
> ** display error
>ENDIF
>
>
>This is true structured programming because it doesn't release the form until all the criteria is met.... BUT... and I know this is wrong for true programmers... but for a large chunk of code, it's easy to lose track of which loop you are in and what needs to happen. I was wondering if there was something like an EXIT call that get you out of the button code and return to the form input.