Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return an Array from a Procedure
Message
From
20/02/2003 12:57:39
 
 
To
20/02/2003 00:16:05
Manmohan Sharma
Mothersonsumi Infotech & Design Limited
Noida, India
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00755344
Message ID:
00755639
Views:
9
>Hi,
>
>I wanted to return an array from a procedure,
>but i am getting only first element of the array.
>
>Thanks in Advance
>
>Manmohan

Starting with VFP7, you can return an array from an object's method. You can not do that from a standard function.
ox = CREATEOBJECT("retarray")
*
* Note the returned array doesn't have to exist first
*
aTest = ox.ArrayValue()
? aTest[3]

DEFINE CLASS retarray AS Custom
  DIMENSION test[3]    && the returned array must be a property of the class
  FUNCTION ArrayValue
    WITH this
      .test[1] = "one"
      .test[2] = "two"
      .test[3] = "three"
    ENDWITH
    RETURN @this.test
  ENDFUNC
ENDDEFINE
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform