Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return Multiple Values From a UDF
Message
From
21/01/2005 10:55:52
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00979276
Message ID:
00979287
Views:
12
>To All:
>IS there a way in VFP to return multiple values from a User Defined Function? I don't want to use an Array, then I have to pass by reference and I am trying to avoid that. I have thought about casting and concatenating the values to a single string then returning that and parsing it when needed but I know there has to be a 'cleaner' way to accomplish this.
>
Hi Woodie

There is many ways.. basically here is two..
Procedure main
SET UDFPARMS TO VALUE
a="1"
b="2"
c="3"
d=udf_setvalue(@a, @b, @c)
? a,b,c
function udf_setvalue
parameters a, b, c
a="3"
b="4"
c="5"
return .t.
set udfparms to reference
a="1"
b="2"
c="3"
d=udf_setvalue(a, b, c)
? a,b,c
function udf_setvalue
parameters a, b, c
a="3"
b="4"
c="5"
return .t.
HTH

Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Reply
Map
View

Click here to load this message in the networking platform