How do you call a sub that returns an array?

MikieK

Member
Licensed User
Longtime User
B4X:
sub one[INDENT]dim a as int
dim b as int
dim c() as int
[INDENT]c() = addandmultiply(a,b)[/INDENT][/INDENT]end sub

sub addandmultiply(d as int, e as int) as int()[INDENT]dim f() as int[INDENT]f(0) = d + e
f(1) = d * e[/INDENT]return f()[/INDENT]end sub

The code above is a rubbish example, and it doesn't work because of "c() = addandmultiply(a,b)" . Is there a way to get around this?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…