Shams

Copying a number from a software to the variable

7 posts in this topic

I wanted to allocate a number within the field in a software to a unique parameter. I used the following command:

$Wet_FGD = Send ( "^C")

MsgBox (0, "Wet FGD", $Wet_FGD)
The first line: I selected the number and as you can see, according to the command, it copies the number. It is supposed to allocate the number to $Wet_FGD parameter. The problem is that when I ask the software to show me the Wet_FGD in MSGBOX, it always shows me 1 while my number is 1.25. To make sure that it copies the number, I pasted the command in a word file which is ok. This problem also occurs to numbers bigger and smaller than 1, such as 0.5648 and 4.133. The output from the MSGBOX is always 1 while the numbers are being correctly copied.

Would you please help me with it????

Share this post


Link to post
Share on other sites



By the way, I do not want it to save into a text or excel file. I just want it to be saved in $Wet_FGD parameter which I can use it later.

Share this post


Link to post
Share on other sites

@Shams - I am not really sure what number you are trying to store in $Wet_FGD from the Send function.  The Send function has no return value.  You are just sending keystrokes.  Where are you getting 1.25 when you say this:

while my number is 1.25.

?


Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Share this post


Link to post
Share on other sites

I am trying to save a number, which is being calculated in another software ( in this case 1.25), into $Wet_FGD variable and use this variable later on for further calculations...As you see, I selected the number (Power Requirement (% MWg) and I send Ctrl+C to copy this number. It does copy the number, but it does not put the number in the variable. If it does not have any returns, how can I allocate that number to the variable (Wet_FGD)????Untitled.thumb.png.25c989c1df02a288725b2

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Oh, okay, I get it now.  Answer: because you are only sending the keystrokes with the Send function.  The Send function does not return anything back when it is run.  It is not storing the result of the "copy" operation that you are performing with those keys.  If you put it to your clipboard by sending those keys you can then do this:

$Wet_FGD=ClipGet ( )

Alternatively, a better way would be to identify the control in the GUI with Au3Info and then try to read it directly from that control.  That would be a bit cleaner.  In the meantime, try this for the clipboard approach:

Send ( "^C")
$Wet_FGD = ClipGet()
MsgBox (0, "Wet FGD", $Wet_FGD)

 

Edited by Jfish

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Share this post


Link to post
Share on other sites

Tnx. It worked with some modifications as I have to put sleep in some sections.

 

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