aleeksunder Posted August 5, 2016 Posted August 5, 2016 Hello! Can anyone explain what's going on here: ; Initializing an array Local $a = [ 0 ] ; Lately in code I want to assign new array to $a variable $a = [ 1 ] and got this error at compile time ==> Error in expression.: $a = [ 1 ] $a = ^ ERROR What is it and why? And I've mentioned that I can't pass "manual" array to function as parameter: a( [ 0 ] ) Func a( $a ) _ArrayDisplay( $a ) EndFunc still the same error ==> Error in expression.: a( [ 0 ] ) a( ^ ERROR
aleeksunder Posted August 5, 2016 Author Posted August 5, 2016 Thanks, i've noticed that Local $a = [ 0 ] Always works. But does that means that I have to always declare Scope when I assign any array variable?
aiter Posted August 5, 2016 Posted August 5, 2016 (edited) just declare it local $a and when you know the dimensions, just do dim $a[$knownscope] [$anotherscope] The reason for your function not knowing its an array is because you did not declare it properly before you called it. Edited August 5, 2016 by aiter more detail
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now