bf2forlife Posted May 14, 2008 Share Posted May 14, 2008 look at this code: Dim $aFuncs[62] = [func a, func b, func c.... But when i try to run it, then comes error. "Error: Missing Separator character after keyword." So how i can fix that? Link to comment Share on other sites More sharing options...
Malkey Posted May 14, 2008 Share Posted May 14, 2008 look at this code: Dim $aFuncs[62] = [func a, func b, func c.... But when i try to run it, then comes error. "Error: Missing Separator character after keyword." So how i can fix that?This works Local $aFuncs[62] = ["funca", "funcb", "funcc"] call($aFuncs[1]) Func funcb() MsgBox(0,"","Funcb Called") EndFunc Link to comment Share on other sites More sharing options...
monoceres Posted May 14, 2008 Share Posted May 14, 2008 (edited) look at this code: Dim $aFuncs[62] = [func a, func b, func c.... But when i try to run it, then comes error. "Error: Missing Separator character after keyword." So how i can fix that?You cannot save functions in an array, what you can do is save the name of the function then use call: Dim $array[3]=["_1","_2","_3"] Call($array[Random(0,UBound($array)-1,1)]) Func _1() MsgBox(0,"","Hello from 1") EndFunc Func _2() MsgBox(0,"","Hello from 2") EndFunc Func _3() MsgBox(0,"","Hello from 3") EndFunc Edit: Beaten to it by Malkey Edited May 14, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
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