Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Try/Catch speed impact???
Message
De
19/11/2012 14:39:52
 
 
À
19/11/2012 05:39:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01557557
Message ID:
01557599
Vues:
77
RETURN Type("GetPem(This.oData, This.cFKField)")
Oooh! I like this.



>>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)")
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform