Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get Window Text, If, Repat, etc.
#1
I have multiple questions and I hope someone can help. I just started using the program and love it to death.


I would like to get the value of a text control, the value is always numeric and if it is less than 100K, I would like to add 1 to it until it reaches 100K.

I was able to record a macro and got as far as selecting the value in the text control. Now I'm stuck.

Thanks for the help!
#2
This example works with QM Find dialog. Repeats while value of edit control text is less than 10.

Code:
int i h; str s

h=id(1127 "Find")
s.getwintext(h)
i=val(s)

for i i+1 10
,s=i
,s.setwintext(h)
,0.2

If edit control is in web page, this will not work. Then you have to use html or accessible object (QM 2.1.2 beta), or copy/paste edit control contents.[/code]
#3
Can I assign the value of a copied value to a variable and go from there?

What I can do is select what's in the edit box and do an Edit, Copy. Then from there, what can I do?

Thanks!
#4
Again, example with QM Find dialog:

Code:
act "Find"

int i; str s

key H SE ;;select
s.getsel
i=val(s)

for i i+1 10
,s=i
,s.setsel
,key H SE
,0.2
#5
I am probably doing something wrong here and couldnt get it to work.

The value of the string is 16,205.00 from the text box control. But the message box is only show 16. Its' suppose to say 16,205.00 Sad



int i h; str s

lef 724 517
h=id(326 "Buy-in")
s.getwintext(h)
i=val(s)

mes i



I tried both examples you provided.
#6
If there is comma, we have to remove it. Also, we should use variable of type double.

Code:
str s
double d

s="16,205.50"
s.findreplace(",")
d=val(s 2)

mes d


Or, use variable of type CURRENCY.

Code:
CURRENCY c
s="16,205.50"

c=s

mes c


Forum Jump:


Users browsing this thread: 1 Guest(s)