stopping further execution of program
[ Courtesy cc'ed through e-mail to the quoted author ]
Quote:
>How do I make sure that the code below stops executing
>when there is an error.
>The problem I am having is that the program continues to execute even
>after there is an error.
>Any help much appreciated.
>*************************************
>mytime = "12:00"
>systime = time()
>CLOSE TABLES ALL
>if val(systime) < val(mytime)
> messagebox("You cannot update now",48,"ATTENTION")
>else
> messagebox("You Can Update Records Now","ATTENTION")
> use c:\bookst\data\booksissd
> append from c:\bookst\data\tdaysbook ;
> for ddate = date()
> on error do errhand
^^^^^^^^^^^^^^^^^^^
This line does nothing - your update is finished by the time it is executed. To
make your error handler active during update, put this line _before_ APPEND
command.
Quote:
>endif
>proc errhand
> messagebox("Record Already Exists, You cannot update
>again",48,"ATTENTION")
And right here you need to quit, not return to your program (RETURN TO MASTER
may be useful, too).
Quote:
>endproc
[ When replying, remove *'s from address ]
Alexandre Pechtchanski, Systems Manager, RUH, NY