Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check if Function/Procedure exists
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00792369
Message ID:
00792376
Views:
18
>I want to get the data from the table and call that function. I would like to put in a validation to check that the specified function exists before I call it, if possible.

If you're using VFP 8, you could wrap it up in a Try Catch block, as in:
try 
   *-- run your code
catch
   *-- Handle the error for a non-existent function.
endtry 
if you're using prior versions of VFP, you'd have to handle that by means of an Error method of an object, or an ON ERROR routine.

However, I'd suggest that instead of running functions, you should rather run methods, so that you could use the PEMSTATUS() functions in order to determine whether the given method is available or not.

HTH
Claudio Lassala
Previous
Reply
Map
View

Click here to load this message in the networking platform