Greenseed Posted November 29, 2005 Share Posted November 29, 2005 (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 bye bye guys! or in another word i can say i wan to start a function from a variable! Edited November 29, 2005 by Greenseed GreenseedMCSE+I, CCNA, A+Canada, QuebecMake Love Around You. Link to comment Share on other sites More sharing options...
LxP Posted November 29, 2005 Share Posted November 29, 2005 You will probably want to look at Call() or Execute(). Link to comment Share on other sites More sharing options...
Helge Posted November 29, 2005 Share Posted November 29, 2005 You will probably want to look at Call() or Execute()..., but note that you have to strip those parentheses, or it will not work. Link to comment Share on other sites More sharing options...
Greenseed Posted November 29, 2005 Author Share Posted November 29, 2005 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. Link to comment Share on other sites More sharing options...
LxP Posted November 29, 2005 Share Posted November 29, 2005 I'm not sure if I understand, but you can't pass parameters to a function that is called with Call(). Link to comment Share on other sites More sharing options...
Greenseed Posted November 29, 2005 Author Share Posted November 29, 2005 i know that 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. Link to comment Share on other sites More sharing options...
LxP Posted November 29, 2005 Share Posted November 29, 2005 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 More sharing options...
Greenseed Posted November 29, 2005 Author Share Posted November 29, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now