Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
On error
Message
From
26/02/2007 10:16:54
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01198769
Message ID:
01198775
Views:
14
This message has been marked as the solution to the initial question of the thread.
>If I wrote
>
>on error 1881 = messagebox ("bad data")

this one is a logical expression so it compare 1881 with the result of messagebox.. it will result always .f.
>
>it works OK, but if I wrote
>
>on error 1881 do form error1
>
>It gives sintax error
>
>What can be wrong ?

try:

m.tipe_err = 1 && serious one
m.tipe_err = 2 && not so serious
m.tipe_err = 3 && just warning

On ERROR DO errorhandler WITH MESSAGE(), ERROR(), LINENO(), m.tipe_err, PROGRAM()
Function errorhandler
    Parameters m.messg, m.error_no, m.lineno, m.code, m.programid
    #if  version(2)=2
         SET STEP ON
    #endif
    If  m.error_no = 1881
        do form error1
        Return
    Endif
HTH
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Reply
Map
View

Click here to load this message in the networking platform