Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you tell if a property is an array (version 8)
Message
 
À
07/04/2009 17:06:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01393713
Message ID:
01393716
Vues:
53
>I have a question about determining whether a variable is an array: From the Help file: (version 8, not 9!)
>
>You can also use the TYPE( ) function to check if a memory variable is an array. For example:
>? TYPE("myarray[1]")#"U"

>
>This apparently works as well for properties. Except for one special counter-example - native properties:
>
>Guesses on the results from the following?
>
?Type("loForm.visible(1)")
>?Type("loForm.visible(0)")
>
>Is there some other consistent method for determining whether a property is an array?

Just do not name the array as native property.
The same is valid for Visible, hWnd etc.


In VFP 8 you coud use:
lbIsArray = .t.
TRY
    leDummy = thisform.Visible[1]
CATCH
   lbIsArray = .f.
ENDTRY
NOT TESTED AT ALL!!!

Later:
GRRRR, Even this gives me .T. t the end

Later than previous later::-)))
lbIsArray = .t.
TRY
    leDummy = ALEN(thisform.Visible)
CATCH
   lbIsArray = .f.
ENDTRY
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform