stopping further execution of program 
Author Message
 stopping further execution of program

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

endif

proc errhand
        messagebox("Record Already Exists, You cannot update
again",48,"ATTENTION")
endproc

--
foxngatia probs

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Mon, 01 Apr 2002 03:00:00 GMT  
 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


Mon, 01 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to stop program execution when calling a new form

2. ON KEY LABEL in program execution?

3. need to speed up program execution

4. Pausing Program Execution

5. Memorizing form configuration during program execution

6. Creating textboxes during program execution

7. query stops program

8. Setting next tab stop to current stop + 2 or more

9. SEEK no further.

10. SEEK no further

11. Relations, was SEEK no further

12. SEEK no further

 

 
Powered by phpBB® Forum Software