rimmi2002

How to send a variable

7 posts in this topic

#1 ·  Posted

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



#2 ·  Posted

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

Share this post


Link to post
Share on other sites

#3 ·  Posted

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

#4 ·  Posted

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

#6 ·  Posted

thank you Jos

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          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