Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an array by Reference
Message
From
12/01/2001 13:51:02
Larry Rix
Larry Rix & Associates, Inc.
Westminster, Colorado, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00463007
Message ID:
00463112
Views:
12
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform