Passing arrays as perameters to a function
Blitz3D Forums/Blitz3D Beginners Area/Passing arrays as perameters to a function
| ||
is there a way to pass an array as a perameter to a function? It would be really great if someone would tell me how... thanks a lot. |
| ||
Well that depends on what u want to do. You could do something like this: And that would assign the variable using a function. |
| ||
You don't need to pass arrays to functions. Arrays are always global so you can access them from within functions anyway. |
| ||
Oh yeah. I forgot about the global part and I thought that you didnt need to pass them to functions but i didnt want to burst anyones bubble |
| ||
This has been covered a million times before, but.. You can pass 'blitz' arrays to functions, like this: Local a[20] blah a Print a[10] End Function blah(b[20]) b[10] = 501 End Function Note that they are single dimensional and cannot be resized, but you can store them in Type objects: Type thing Field a[20] End Type |
| ||
thanks |