Posts: 7
Threads: 3
Joined: May 2004
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!
Posts: 12,092
Threads: 142
Joined: Dec 2002
This example works with QM Find dialog. Repeats while value of edit control text is less than 10.
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]
Posts: 7
Threads: 3
Joined: May 2004
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!
Posts: 12,092
Threads: 142
Joined: Dec 2002
Again, example with QM Find dialog:
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
Posts: 7
Threads: 3
Joined: May 2004
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
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.
Posts: 12,092
Threads: 142
Joined: Dec 2002
If there is comma, we have to remove it. Also, we should use variable of type double.
str s
double d
s="16,205.50"
s.findreplace(",")
d=val(s 2)
mes d
Or, use variable of type CURRENCY.
CURRENCY c
s="16,205.50"
c=s
mes c