rimmi2002 0 Posted April 14, 2017 Func EnterICD($code="92929", $returnVN=1) MCL(1706,758) ;Click level or service window Send("{"&$code&"}") EndFunc Hi I am using the following function. I would like this fuction to type in the variable $code into the box it clicks. However it will only send the first digit "9", nothing else. How can I get it to work. Thanks. Share this post Link to post Share on other sites
Subz 473 Posted April 14, 2017 Remove the curly brackets i.e. Send($code) Share this post Link to post Share on other sites
DarkDragon 1 Posted April 15, 2017 Func EnterICD($code="92929", $returnVN=1) MCL(1706,758) ;Click level or service window Send( "{" & $code & "}" ) EndFunc Why it doesn't work? Share this post Link to post Share on other sites
DarkDragon 1 Posted April 15, 2017 You want to send only the first number, soo you should use the StringLeft() function. Func EnterICD($code="92929", $returnVN=1) MCL(1706,758) ;Click level or service window $code=StringLeft($code, 1) ;This function catch only the first number of the variable from the left side of the string Send( "{" & $code & "}" ) EndFunc Try this script it must work fine. Share this post Link to post Share on other sites
Jos 1,565 Posted April 15, 2017 5 minutes ago, DarkDragon said: Why it doesn't work? That was already explained by @Subz ! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
Jos 1,565 Posted April 15, 2017 (edited) 4 minutes ago, DarkDragon said: Try this script it must work fine. No it will not, as stated, you need to remove the curly brackets to get the total string send in stead of just the first character. I think you are confused as to the reported problem. Jos Edited April 15, 2017 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites