Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Initializing/add an object in a method/proc of a class
Message
 
À
20/09/2007 13:06:34
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01255782
Message ID:
01255784
Vues:
12
This message has been marked as the solution to the initial question of the thread.
>I wrote a procedure that will initialize/add an object, but it will only work at the THIS level. Fine for what I needed it for, but how can I use it at other levels of a class? Say, one level down from "THIS", so that it would be "THIS.oObject" that I wanted to run it for?
>
>
>	*******************************************************************************
>	PROCEDURE InitializeObject(ObjectName)
>
>		IF PEMSTATUS(THIS,ObjectName,5)
>			THIS.ObjectName = NULL
>		ELSE
>			ADDPROPERTY(THIS,ObjectName)
>		ENDIF
>
>	ENDPROC
>
If this is a class definition that will work no mater at what level is your class. That property will be available in all subclasses also. If you want to use that property outside of that class you must use it that way:
*** Lets say that class instance is named MyClass1 in the form:

thisform.MyClass1.ObjectName.DoSomething && If ObjectName is object
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform