Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing an array by Reference
Message
De
12/01/2001 13:51:02
Larry Rix
Larry Rix & Associates, Inc.
Westminster, Colorado, États-Unis
 
 
À
12/01/2001 13:40:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00463007
Message ID:
00463112
Vues:
13
Send your SQL output directly to a local array variable:

select * from MyTable into array laMyArray

acopy(laMyArray,THISFORM.iaMyArray)

= MyProgram(@laMyArray)

While the solution adds one step (e.g., acopy), it is in keeping with a coding specification that I try to follow: Do all work possible to local variables and distribute them to and from their target and source data items when the work is beginning or done. This affords several things:

1. The beginning of all my methods or PRG procedures do the initial work of bringing in all my working data material from whatever sources.

2. The end of the same methods or procedures then put everything back into place.

Therefore, I never have to wade through state changing code looking for where things are coming from or going to. I ever have to look to the beginning or ending of the code to see data sources and targets.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform