Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Try/Catch/Finally/Endtry mismatch, error #2058
Message
De
17/07/2003 19:03:08
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregon, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Try/Catch/Finally/Endtry mismatch, error #2058
Divers
Thread ID:
00811323
Message ID:
00811323
Vues:
74
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform