Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Identifying arrays
Message
De
01/11/2000 10:16:18
 
 
À
31/10/2000 05:09:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00436254
Message ID:
00436675
Vues:
20
>try TYPE("variable[1]").
>This will return U unless vaiable is an array.

Actually, it's a little more complicated that than. Note that TYPE('OBJECT.NAME[1]') returns 'C', not 'U'; that's true for all native properties of an object. The best way I've found is to test for element 0 as well, because while an array can't have an element 0, TYPE('OBJECT.NAME[0]') still returns 'C'. So, the following routine will return .T. if the specified property for the specified object is an array:
lparameters toObject, tcProperty
return type('toObject.' + tcProperty + '[0]') = 'U' and ;
  type('toObject.' + tcProperty + '[1]') <> 'U'
Doug
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform