Returning Arrays

Blitz3D Forums/Blitz3D Programming/Returning Arrays

Bnesiba(Posted 2006) [#1]
is it possible? if so, how? if not, workaround?


Defoc8(Posted 2006) [#2]
As far as i know/remember - its not possible to return arrays,
you can however create container types...

type intArray
data[MAX_SIZE]
endtype

or you can simply use global arrays...and write to the one
that best fits your purpose..

my b3d knowhow is rusty...but i think the answer is NO..


kevin8084(Posted 2006) [#3]
Arrays are global. You don't need to explicitly return an array from a function. Changing the array within a function changes it globally. For example:
Dim a(10)
For x=0 To 9
	a(x)=x
Next
For x=0 To 9
Print a(x)
Next
doit()
For x=0 To 9
Print a(x)
Next
WaitKey()

End

Function doit()
For z=0 To 9
	a(z)=7
Next
End Function

Was this what you were looking for?


b32(Posted 2006) [#4]
http://www.blitzbasic.com/Community/posts.php?topic=62912