Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Como saber si una variable es tipo array?
Message
From
08/02/2002 21:11:13
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00616974
Message ID:
00617824
Views:
30
>Hola, Hilmar.
>
>Efectivamente es más rápido, y se comporta igual que type(). El problema es que type() necesita convertir tomar la string y buscar la variable en tiempo de ejecución, mientras que vartype() al recibir la variable como parámetro, ya está apuntando directamente a ella.
>
>El efecto de cambiar una función por otra en los métodos principales y funciones básicas de tu framework, donde tal vez necesitas el tipo de un dato o un objeto en cada refresco, inicialización, etc, de un control, puede ser dramático.
>
>Te recomiendo que le eches una mirada.

A ver si entendí correctamente:

1) vartype() es más rápido, pero falla cuando la variable no existe.

2) Por lo tanto, cuando sabemos de antemano que la variable sí existe, es recomendable usar vartype(variable) en vez de type("variable").

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform