Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GATHER NAME problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00806421
Message ID:
00806425
Vues:
23
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform