Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return an array from a program
Message
De
29/12/2003 21:51:12
 
 
À
29/12/2003 11:00:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00862520
Message ID:
00862721
Vues:
10
Joseph,

>>How do I return an array from a program, as opposed to returning just the first element of that array?

If you establish the array in the calling program, you can pass a reference to the array in the called program (preceed the array name with the "@" symbol), which can then fill up the array. For more details see the help file on passing parameters by reference.
LOCAL ARRAY aTest[1,1]
OTHER_PROGRAM(@aTest)

? aTest[1,1]  && returns 'Test 1'
? aTest[2,1]  && returns 'Test 2'
? aTest[3,1]  && returns 'Test 3'

RETURN .T.


PROCEDURE OTHER_PROGRAM
LPARAMETERS aRefTest

DIMENSION aRefTest [3,1]
aRefTest[1,1] = 'Test 1'
aRefTest[2,1] = 'Test 2'
aRefTest[3,1] = 'Test 3'

RETURN .T.
ENDPROC
David
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform