rimmi2002 Posted April 14, 2017 Share 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. Link to comment Share on other sites More sharing options...
Subz Posted April 14, 2017 Share Posted April 14, 2017 Remove the curly brackets i.e. Send($code) Link to comment Share on other sites More sharing options...
DarkDragon Posted April 15, 2017 Share 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? Link to comment Share on other sites More sharing options...
DarkDragon Posted April 15, 2017 Share 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. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 15, 2017 Developers Share 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 etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
DarkDragon Posted April 15, 2017 Share Posted April 15, 2017 thank you Jos Link to comment Share on other sites More sharing options...
Developers Jos Posted April 15, 2017 Developers Share 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 etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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