Jump to content

Start Function With A variable


 Share

Recommended Posts

i wan to read into my ini the function name and then execute the function!

$functioname=IniRead ( "filename", "section", "key", "default" ); $functionname = _test()


$functionname;********this is supossed to start the function**************


func _test($msg="")
         msgbox(0,"test", $msg)
endfunc

i know it not working and i know it not the right manner to do it! but it to be sure you understand what i

mean!

my english is not perfect and i wan to be sure hehe :oB) bye bye guys!

or in another word i can say i wan to start a function from a variable!

Edited by Greenseed

GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You.

Link to comment
Share on other sites

Something like this might work:

Global $Params[10]
For $I = 0 To 9
    $Params[$I] = INIRead('C:\Path\To\INI', 'Section', 'Param' & $I, '')
Next

Local $Func = INIRead('C:\Path\To\INI', 'Section', 'Func', '')
If $Func Then Call($Func)

Func MyFunction()
    Local $Name = $Params[0]
    Local $Phone = $Params[1]
    ···
EndFunc
Link to comment
Share on other sites

Something like this might work:

Global $Params[10]
For $I = 0 To 9
    $Params[$I] = INIRead('C:\Path\To\INI', 'Section', 'Param' & $I, '')
Next

Local $Func = INIRead('C:\Path\To\INI', 'Section', 'Func', '')
If $Func Then Call($Func)

Func MyFunction()
    Local $Name = $Params[0]
    Local $Phone = $Params[1]
    ···
EndFunc
the idea is to past my func param to the local variable in the function! i understand! nice ide thx! Mr!

bye bye!

GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You.

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