Visual basic 6.0: function returning array

Is there better way how to create function returning array than:

function foo
 Dim bar(1 to 2)as double
 bar(1)=1
 bar(2)=2
 foo=bar
end function

and in code:

arrayx=foo

Because when I declare Dim arrayx(1 to 2) as double it throws an error "can't assign array" When I don't declare the variable arrayx it doesn't seem to have any problems.

5
задан Cody Gray 19 May 2011 в 08:48
поделиться