Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Initializing/add an object in a method/proc of a class
Message
 
To
20/09/2007 13:06:34
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01255782
Message ID:
01255784
Views:
13
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform