Message
From
17/07/2003 19:03:08
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregão, United States
 
 
To
Todo
General information
Fórum:
Visual FoxPro
Category:
Título:
Try/Catch/Finally/Endtry mismatch, error #2058
Miscellaneous
ID da thread:
00811323
ID da mensagem:
00811323
Views:
75
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
Responder
Mapa
View