Link to home
Start Free TrialLog in
Avatar of Milewskp
MilewskpFlag for Canada

asked on

How to create an array function

Is it possible to create a custom function that returns an array, so that I can assign that function to an array variable?





Note to self: If it is possible, revise XRisk() accordingly.
SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A few different ways but this is one:

Function yourFunction () as variant ()
Dim vArray as variant

YOUR app

yourFunction = vArray


End function
What version of VB is this.  In VB5 (and earlier versions) you had to return a Variant data type as noted by matthewspatrick.  In VB6, you were allowed to return an array.

What is XRisk()?
Avatar of Milewskp

ASKER

Hi, aikimark
XRisk() is just the name of a function I'm using. How can I tell if I'm using VB5 or 6? Can you show me an example of a VB6 array function?
click the help about menu.  The version will be displayed in the subsequent dialog box.
I have VB 6.5, Version 1053? Can you show me an example of a VB6 array function?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks everyone!