Jump to content

Recommended Posts

Posted

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?

Posted

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
Posted (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 by monoceres

Broken link? PM me and I'll send you the file!

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
  • Recently Browsing   0 members

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