Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Issue: AINSTANCE()
Message
From
06/02/2005 07:45:52
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Issue: AINSTANCE()
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00984294
Message ID:
00984294
Views:
60
VFP Help:
"Only class instances assigned to variables and array elements
with CREATEOBJECT( ) or NEWOBJECT( ) are placed into the array. "

Result: AINSTANCE is pratically useless.
CLEAR
CLEAR ALL
goINSTANCE1 = CREATEOBJECT('Form')
ADDPROPERTY(_SCREEN,"INSTANCE2",CREATEOBJECT('Form')) && HIDDEN
WITH  CREATEOBJECT('Form')	&& HIDDEN
	FOR K=1 TO AINSTANCE(gaMyArray, 'Form')
		? gaMyArray[m.k]
	NEXT
        RELEASE gaMyArray
ENDWITH
REMOVEPROPERTY(_SCREEN,"INSTANCE2")
Then:
AINSTANCE(ArrayName, cClassName, [allInstance])
* fill ArrayName with all object values for the cClassName
it is very usefull.

Others very usefull are:
AREFERENCE(ArrayName, object )
* Return all variable names (m.XXXX) or the property (path\property)
* that reference to an object.
* then EVAL(ArrayName[k]) is the object reference to object.

WITHSTACK(widthLevel) and WITHSTACKLEVEL()
* return the current WITH stack status
* WITHSTACK(N) for N>WITHSTACKLEVEL() return a NULL object
* WITHSTACK() return the current with value
Fabio
Next
Reply
Map
View

Click here to load this message in the networking platform