Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debugger
Message
From
18/02/2016 12:52:26
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
18/02/2016 12:15:35
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows 7
Database:
Oracle
Application:
Desktop
Miscellaneous
Thread ID:
01631676
Message ID:
01631682
Views:
50
>How to get the debugger to fire up when an error occurs in a compiled exe?
>Thanks!

As long as you run it from IDE
DEBUG opens the debuger
SUSPEND pauses
SET STEP ON does both

SET ASSERTS ON and a later ASSERT .f. (or ASSERT lExpression where lExpression returns .f. for that) suspends

if you do not run from IDE
none

in short terms
in your main.prg add function
FUNCTION On_Error
 SET STEP ON
 RETRY
ENDFUNC
in main add
ON ERROR On_Error
So the error should call the On_Error and you can singlestep back to the error.
Note, the example above only catches the error. Any information about the error given by all all the stuff like AERROR ERROR MESSAGE and so is up to you.
IOW simple catching and calling debugger is not enough.
See HELP ON ERROR for example.

Do not use this in code outside the IDE, any error will cause a loop.

HTH
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform