Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning array from Form
Message
From
29/08/2014 11:26:43
 
 
To
29/08/2014 10:45:54
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01606569
Message ID:
01606721
Views:
43
>>>>Just to show how rusty my VFP is:
>>>>
>>>>How should I return an array from a (modal) form. Calling line this:
DO FORM xxxx WITH SourceData TO ReturnData
I know I have to return it from the Form.Unload() but.....?
>>>>
>>>>FWIW I can make the array local or a property of the form - but I think it needs to be a property ?
>>>
>>>You cannot return an array. If you do it only returns the first element of the array
>>>
>>>As mentioned, use an object
>>>
>>>do Form xx to tt
>>>
>>>
>>>Unload
>>>
>>>local obj, nElements
>>>obj = createobject('empty')
>>>nElements = 24
>>>
>>>= addproperty(m.obj, 'aa[m.nElements]')
>>>local i
>>>for i = 1 to m.nElements
>>>	obj.aa[m.i] = m.i
>>>endfor
>>>
>>>=dodefault()
>>>
>>>return m.obj
>>>
>>
>>Thanks both. Ended up passing the object to the calling form (since it basically modified an existing array) so there was no need to pass anything back...
>
>
>Enjoy

Don't think I'm capable of enjoying VFP any more :-}
Previous
Reply
Map
View

Click here to load this message in the networking platform