Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Big trouble with AddProp5.fll
Message
 
To
28/05/2002 10:01:16
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00661729
Message ID:
00662102
Views:
26
>Thanks for your time, Christof.
>
>Foar a while, the workaround I´ve found filled my needs. In a near future, hopefully we´ll have more support for AddProp in "SCATTERED" objects. ;)

One way to handle adding properties to SCATTERed objects may be to approach this from the other side. You can replace the native SCATTER command with your own function MYSCATTER which may work on any area
* myScatter.PRG
myScatterObject = CREATEOBJECT("myScatterObject")
IF !EMPTY(ALIAS())
	lnFields = FCOUNT(ALIAS())
	FOR N =1 TO lnFields
		myScatterObject.ADDPROPERTY(FIELD(N), EVAL(FIELD(N)))
	ENDFOR
ENDIF
RETURN myScatterObject && Always return an object, so GATHER command could not choke.

DEFINE CLASS myScatterObject AS SESSION
* Optionally you may define the native PEMs here as HIDDEN 
ENDDEFINE
Then you go to the record you need and:
SELECT mytable 
scattered1 = MYSCATTER() && This is instead of SCATTER NAME...

* .... && more code here

* Now add a property using the native AddProperty method and assign any value to it.
scattered1.addProperty("newPropertyName", "This is the new property value")

SELECT othertable
GATHER NAME scattered1 MEMO 
Note that you still can use the native GATHER command here.
The scope of scattered1 variable and other code safety features are up to you.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform