Jump to content

Recommended Posts

Posted (edited)

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.

Posted

You will probably want to look at Call() or Execute().

.., but note that you have to strip those parentheses, or it will not work.
Posted

thx guys you fast! i just make some test or i do i pass variable to the function?

global $msg


$test = "_test"


call($test)


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

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

Posted

I'm not sure if I understand, but you can't pass parameters to a function that is called with Call().

Posted

i know that B) they maybe a way to do it with parsing variable!

the only solution i see for the moment is

to autorecompile the script each time to acomodate the functionName!

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

Posted

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
Posted

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.

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
×
×
  • Create New...