Jump to content

Passing an array as parameter with a $variable default.


JRowe
 Share

Recommended Posts

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
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...