Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Arrays from DO FORM
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
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:
01436725
Views:
79
Looks great!

Thanks a bunch!

>Tommy,
>
>I usually approach the problem in a different way. I pass an object based on empty to the form, save it as a form's property and add an array to this object.
>
>E.g.
>
>local loParamObject
>loParamObject = createobject('empty')
>
>form's Init
>
>lparameters toParamObject
>thisform.oParamObject = toParamObject && you can create oParamObject property in your base form class
>
>form's Unload
>
>addproperty(thisform.oParamObject,'aReturnArray[1]')
>populate the array
>
>Now you can access this array from that obect loParamObject.
>
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform