Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error handling

Status
Not open for further replies.

CleoMan

Programmer
Jun 18, 2003
110
ZA
It's been a while..

Alright, this is basically what i want to do:

I want to use error handling in a script that i wrote,but when I trap the errors I want to be able to distinguish between unexpected errors and errors that I created with a fail statement.

Example:

if not tc.open(table.db) then
msgStop("","Descriptive message")
fail()
endif

So what should happen is that I trap this error and know what the error is and handle it differently, than I would handle a error that is caused by something that I did'nt plan for (A error generated by SQL).

I know in VB you can create your own error codes to identify errors created by the programmer and errors created by the program.

So how can i do something similar in Paradox 9?

Hope this question makes sense
Thanks in advance
Richard
 
You have excellent error control in Paradox including creating your own error codes. Use enumRTLConstants() or enumRTLErrors() to get a listing of the error constants and look up "error constants" in objectPal help for info on creating your own error constants.


if not tc.open(table.db) then
ec = errorCode()
if ec = -30463 then
errorMessage()
fail()
endif
endif

Hope this helps
Perrin
 
Yup, I've got it working now. Used this and a little more searching in the help files, and everything is now running smooth.

Thanks alot Perring
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top