Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Errors
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00521954
Message ID:
00521966
Views:
18
>In case you have not created some code to do this, here is what I did several years ago. Note that error 1116 is a gotcha.
>#Include FoxPro.h
>local lcTable
>lcTable = ""
>lcTable = getfile("Error Table:DBF")
>if empty(lcTable)
>   return
>endif
>close tables all
>use (lcTable) excl alias Errors
>local lnRetVal
>lnRetVal = MessageBox("Zap table first?", MB_ICONQUESTION + MB_YESNO, "Warning...")
>if lnRetVal = IDYES
>   zap
>endif
>set order to errnum
>on error do SetError
>for i = 1 to 5000
>   if i = 1116      && Too many window open error which stops execution
>      insert into Errors ( ErrNum, Descript ) ;
>         values ( 1116, "Too many windows open." )
>      loop
>   endif
>   error(i)
>endfor
>on error
>return
>
>
>procedure SetError
>*
>local array laError[1]
>local llInsert
>lnRetVal = aerror(laError)
>if lnRetVal = 0
>   return
>endif
>llInsert = .t.
>if laError[1,1] = 1941  && I do not remember why I put this here
>   seek 1941
>   if not eof()
>      llInsert = .f.
>   endif
>endif
>if llInsert
>   insert into Errors ( errnum, descript ) ;
>      values ( laError[1,1], laError[1,2] )
>endif
>return
>
I know why you put 1941 there...it's "Error code is not valid". IOW, it's what's generated when you issue ERROR with a parameter and the error doesn't exist.:-)

Basically, I did something similar (but not as sophisticated).
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform