Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error Handling Priority
Message
From
26/09/2013 02:00:12
 
 
To
25/09/2013 15:30:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01584109
Message ID:
01584156
Views:
51
Whenever fox behaves remarkebly unexpected, I first add logging to places I had expected to code to touch and soon afterwards replace "with" references with actual local variables, as in very few scenarios there are errors inside the vfp engine caused by "with" - not often enough to overcome typing lazyness, but when you run into it it costs time - the same code with local vars works, with "with-references" fails.

>I caught that one later, as well as another bug with RemoveObject.
>
>I'm having the thought that because the error is actually happening inside RemoveObject (object not found) it is outside the scope of TRY/CATCH and goes right to the form error handler.
>
>>Not sure why the on error is firing, but the problem is deeper (and in this case your issue with it is moot), your code will never work as you are expecting, you will enter an infinite loop as the EXIT will exit the try catch block, not the DO WHILE as you are thinking, if you do not believe me or the help (look for EXIT COMMAND: "Exits a DO WHILE, FOR, SCAN, or TRY…CATCH…FINALLY structure.") then try this simple program:
>>
>>
>>set escape on && I am such a nice guy...
>>do while .t.
>>	try
>>		abc
>>	catch to loException
>>		? loException.Message
>>		exit
>>		? 'I am never printed'
>>	endtry
>>enddo
>>
>>
>>Enjoy infinity :)
Previous
Reply
Map
View

Click here to load this message in the networking platform