Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GATHER NAME problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00806421
Message ID:
00806425
Views:
21
Here's some code that illustrates the problem.

*--------------test.prg---------------------------------------------------
LOCAL loTest

loTest = CREATEOBJECT("TestClass")
loTest.MainMethod()

RETURN

DEFINE CLASS TestClass AS Custom
FUNCTION MainMethod

LOCAL loItems

this.MakeTable()

loItems = this.GetItems()

SELECT Items
LOCATE
FOR EACH loItem IN LoItems
*-- LoItem.Field2 = "Changed"
GATHER NAME loItem MEMO
IF NOT EOF()
SKIP 1
ENDIF
ENDFOR
*-- But it doesn't here
BROWSE NORMAL NOCAPTIONS

ENDFUNC

FUNCTION GetItems
LOCAL loItems,loItem

loItems = CREATEOBJECT("Collection")

SELECT Items
SCAN
loItem = this.GetSingleItem()
loItems.Add(loItem)
ENDSCAN

RETURN loItems
ENDFUNC

FUNCTION GetSingleItem
LOCAL loItem

SELECT Items
SCATTER NAME loItem MEMO

loItem.Field2 = "Changed"

RETURN loItem
ENDFUNC

FUNCTION MakeTable
LOCAL lnCount

CREATE TABLE Items(;
Field1 N(4), ;
Field2 C(10))

FOR lnCount = 1 TO 3
INSERT INTO Items VALUES (lnCount,"Record " + TRANSFORM(lnCount))
ENDFOR

ENDFUNC

ENDDEFINE
*-------test.prg-------------------------------------------
Cheers,
Jamie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform