Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Referencing an object using a variable for the object na
Message
De
15/08/2001 14:56:54
 
 
À
15/08/2001 14:48:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00544237
Message ID:
00544247
Vues:
16
*>In this situation, I need to (1) check to see if an object exists

* You spelled "loObject" as "loOption" in your posted code, that might cause a problem

lParameter lcObjectClass
Local loObject, loArray
loObject = "o" + lcObjectClass
IF TYPE("THIS." + loObject + ".array") = "U"
	THIS.AddObject(loObject, lcObjectClass)
ENDIF

*> Get array reference (is there a better way to do this?
*> This works but seems a little clumsy.)

*>loArray = "Session." + loObject + ".array"
*>loArray = Evaluate(@loArray)

* Not sure what you're trying to do. You might be better off with a new array
lcArray = "Session." + loObject + ".array"
=acopy(&lcArray, laArray)
This.DoSomething(@laArray) && this does not work, array does not pass by reference
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform