Jump to content

Random functions?


Recommended Posts

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!

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...