Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Arrays from DO FORM
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Passing Arrays from DO FORM
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01436626
Message ID:
01436626
Views:
135
Hi Gang!

I want to pass an Array BACK to a calling Procedure....

Calling Procedure ->
DO FORM frmlookup TO laLookup

where laLookup is an array....

and the called form's UNLOAD event is...
LOCAL ARRAY laItemNo(2)

*TMT 11/24/09 Modified the code to send the data back as 2 elements of an array
*laItem(1) is the Item No  and laItem(2) is the TranID of the Transaction
IF csr_regtrans.rx_no > 0	&& This is a Rx Item
	laItemNo(1) = ALLTRIM(STR(csr_regtrans.rx_no)) +   PADL(ALLTRIM(STR(csr_regtrans.refill_no)),2,"0")
ELSE
	laItemNo(1) = csr_regtrans.upc_code
ENDIF 

*TMT 11/24/09 laItem(2) which is the Tranid
laItemNo(2) = Thisform.p_tranid

POP KEY
USE IN csr_regtrans
SELECT refund
RETURN laItemNo
When I trace the code, the laLookUp has 2 elements, but they are the same thing!

I know this has to do with pass by value versus pass by reference, but my attemps to fix it have failed.

So what am I doing wrong today?

Thanks!
Tommy Tillman A+ NetWork+ MCP
Next
Reply
Map
View

Click here to load this message in the networking platform