Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning array from Form
Message
From
28/08/2014 01:51:19
 
 
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:
01606597
Views:
72
>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
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform