Jump to content
rimmi2002

How to send a variable

Recommended Posts

rimmi2002
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

Remove the curly brackets i.e. Send($code)

Share this post


Link to post
Share on other sites
DarkDragon
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

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
DarkDragon

thank you Jos

Share this post


Link to post
Share on other sites
Jos
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 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

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

×