Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Try/Catch speed impact???
Message
From
19/11/2012 05:39:58
 
 
To
18/11/2012 23:25:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01557557
Message ID:
01557561
Views:
86
This message has been marked as a message which has helped to the initial question of the thread.
>Does anyone know the speed impact of using Try/Catch statements in VFP code? My intuition says there must be some hit, but I'm just curious if anyone has any hard data or real world experience with quantifying the performance hit of using this???
>
>For instance, here is the defensive use of Try/Catch I am contemplating. It guards against cases where a property name does not exist on an object. This code will be called very frequently in my app, so I want to make sure it's as fast as possible, but I still need a safety net in case the property name is not on the object.
>
>
>
>Local lcFKDataType
>
>Try
>	lcFKDataType = Vartype(GetPem(This.oData, This.cFKField))
>Catch
>	lcFKDataType = 'U'
>Finally
>EndTry 
>
>Return lcFKDataType
>
>
You can uses Type
RETURN Type("GetPem(This.oData, This.cFKField)")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform