Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Try/Catch/Finally/Endtry mismatch, error #2058
Message
From
17/07/2003 19:03:08
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregon, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Try/Catch/Finally/Endtry mismatch, error #2058
Miscellaneous
Thread ID:
00811323
Message ID:
00811323
Views:
72
I encountered a VFP 8 syntax "gotcha" issue that cost me some time. My search in Microsoft's knowledge base and here on the UT did not turn up the issue or solution. I do not pretend to know the technical answer why this issue exists but here it is and the solution.

The following code compiles without error but, at runtime, generates error 2058 on my XP (SP1) machine. The gotcha is the use of the "m." variable alias with the exception object on the CATCH line. Unfortunately I found error 2058's description of little assistance. Solution: Simply remove the "m." and the problem is gone.
try
    ? "Inside TRY"
catch to m.loException  && Remove the "m." alias and it runs fine
    ? "Inside CATCH"
finally
    ? "Inside FINALLY"
endtry
Perhaps this will save someone else some time.

Spence
Next
Reply
Map
View

Click here to load this message in the networking platform