Jump to content

Recommended Posts

Posted (edited)

Say I have a multi-dimensonal array like so: the 0th , is the display name of the item. The 1st is the Function name, and the 2nd is a general flag used later. How do i call the functions using a loop?

What if one of the functions requires something passed like...the 3rd. The loop I would use to call them is below. I am trying to call the function name that is declared in the array.

Dim $aPwners[3][3] = [ _
                ['Ouch','_iOuch()','0'], _
                ['Death','_iDeath()','0'], _
                ['Pwn','_iPwn()','0'], _
                       ['Rawr','_iRawr($itemtobepassed)','0'] _
            ]oÝ÷ Ù«­¢+Ù½ÈÀÌØí¤ôÀѼÀÌØíAݹÉÍM¥é´ÄìÀÌØíAݹÉÍM¥é±Éɱ¥È($ÀÌØíAݹÉÍlÀÌØí¥ulÅtì±Ðì´ôôôôôôôQ¡¥Ì¥ÌÝ¡É$´ÑÉ她Ѽ±°Ñ¡Õ¹Ñ¥½¸¹µÑ¡Ð¥Ì¥¸Ñ¡ÉÉä°à¸¡}¥=Õ °}¥Ñ ¸¸¹Ñ¸¤!½Ü¼¤¼Ñ¡¥Ìü)9áÐ
Edited by dufran3
Posted (edited)

Would you not be able to just get $title from within the function? Or set a Global $title = 'whatever' before the function is called, and then just use $title inside the function?

edit - Just had a glance at the Call function in the help file. Your answer for passing args is there. :whistle:

Edited by xcal
Posted

Would you not be able to just get $title from within the function? Or set a Global $title = 'whatever' before the function is called, and then just use $title inside the function?

edit - Just had a glance at the Call function in the help file. Your answer for passing args is there. :whistle:

Actually calling a function with args is that way better...

I don't like global variables ^^

(After having one of my scripts cleaned from global variables that caused it no longer working ^^)

Posted (edited)

I just ended up making another element with the "parameter" to pass it.

Dim $aPwners[3][4] = [ _
                ['Ouch','_iOuch()','0','parameter1'], _
                ['Death','_iDeath()','0','parameter2'], _
                ['Pwn','_iPwn()','0','parameter3'], _
                       ['Rawr','_iRawr','0','parameter4'] _
            ]oÝ÷ Ù«­¢+Ø)½ÈÀÌØí¤ôÀѼÀÌØíAݹÉÍM¥é´ÄìÀÌØíAݹÉÍM¥é±Éɱ¥È(
±° ÀÌØíAݹÉÍlÀÌØí¥ulÅt°ÀÌØíAݹÉÍlÀÌØí¥ulÍt¤)9áÐ(
Edited by dufran3

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