Sign in to follow this  
Followers 0
JRowe

Passing an array as parameter with a $variable default.

2 posts in this topic

I have a global array set in an include. I want to pass that array to some functions without having to specify _SomeFunc($myArray, param1, param2).

I want to pass that array ByRef.

Is there anything wrong with this?

Global $myArray[1]

Func SomeFunc($param1, $param2, Byref $inFuncArray = $myArray)
;Do stuff with params and arrays
EndFunc

Share this post


Link to post
Share on other sites



Scratch that, that was a dumb question. Global arrays can be accessed anywhere, thus the point of the Global keyword.

/Facepalm@self

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0