Hi,
I'm having difficulty deciding the best way to validate several fields in an application window. Here is the scenario:
There are several fields (lets say 4) that have the validation code already written for them. The way I need them to validate is once a button is pressed it does a number of writes to a database but first it hits a validation procedure.
Within this validation procedure is a validation procedure for each of the fields (so 4 procedures). I need the program to halt and wait for the user to fix their issue before continuing. The only way I can think to do this is a loop however it will only be an infinate loop. Any help is greatly appreciated.
Thanks.
Edit: Just got an idea on this... return a variable that has a fields name in it. Return to the calling ON CHOOSE OF btn:
/*all variables are global */
DO WHILE v-flg = NO:
RUN validProc NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
APPLY "ENTRY":U TO var1.
END.
ELSE DO: /* no errors */
ASSIGN v-valid = YES.
END.
END.
My only beef with this is how this can be done where var1 stores the name of the field. Any takers on this approach?
I'm having difficulty deciding the best way to validate several fields in an application window. Here is the scenario:
There are several fields (lets say 4) that have the validation code already written for them. The way I need them to validate is once a button is pressed it does a number of writes to a database but first it hits a validation procedure.
Within this validation procedure is a validation procedure for each of the fields (so 4 procedures). I need the program to halt and wait for the user to fix their issue before continuing. The only way I can think to do this is a loop however it will only be an infinate loop. Any help is greatly appreciated.
Thanks.
Edit: Just got an idea on this... return a variable that has a fields name in it. Return to the calling ON CHOOSE OF btn:
/*all variables are global */
DO WHILE v-flg = NO:
RUN validProc NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
APPLY "ENTRY":U TO var1.
END.
ELSE DO: /* no errors */
ASSIGN v-valid = YES.
END.
END.
My only beef with this is how this can be done where var1 stores the name of the field. Any takers on this approach?