Posts: 166
Threads: 57
Joined: Aug 2013
Greetings,
I am unable to populate an editable text box with data froma string variable.
Macro
Get Cost Options
,Acc a4.Find(w2 "TEXT" "" "class=KCMLEdit32[]state=0x100000 0x20000040" 0x1004)
,a4.SetValue(F"{varVIN}") ; 0.25
Kindly advise.
Best Regards,
Philip
Best Regards,
Philip
Posts: 11,869
Threads: 138
Joined: Dec 2002
Not all editable text boxes support SetValue. For example, it works in Internet Explorer but not in Firefox. When does not work, use Select and key or paste.
a4.Select(1) ;;if 1 does not set focus, try 2 or 3
key HSE (varVIN) ;;HSE selects existing text (Home Shift+End)
Posts: 166
Threads: 57
Joined: Aug 2013
Tried those. Does not work even with 1,2,3 options...
I tried the below too and it used to work with another window earlier but not now....
Macro
Get Cost Options
,Acc a4.Find(w2 "TEXT" "" "class=KCMLEdit32[]state=0x100000 0x20000040" 0x1004)
,a4.Select(1) ;;if 1 does not set focus, try 2 or 3
,int row
,for row 0 arrVIN.len
,,key (arrVIN[0 row]);;type cell
Best Regards,
Philip
Posts: 11,869
Threads: 138
Joined: Dec 2002
If a4.Select(1) does not set focus, use a4.Mouse(1)
Is it a str variable?
Posts: 166
Threads: 57
Joined: Aug 2013
varVIn is a str variable and arrVIN is an array variable.
I have both in the program.
I tried the mouse option too.
For some reason it does work as well.
Just to give you a bigger picture, the program first clicks a radio option button and the editable text already has focus.
I can see the cursor active and I am able to enter into it manually...
Any workarounds?
Best Regards,
Philip
Posts: 166
Threads: 57
Joined: Aug 2013
Thanks Gintaras.
The select method itself worked.
The mistake was in the incorrect conversion from my end of array to string variables...
Sorry and thanks for your time...
Best Regards,
Philip
Posts: 11,869
Threads: 138
Joined: Dec 2002
Then key varVIN or paste varVIN must work. If doesn't, maybe varVIN is empty. Try to debug:
out varVIN
paste varVIN
Posts: 166
Threads: 57
Joined: Aug 2013
Thanks Gintaras, it's done.
Yes the varVIn was empty...
Best Regards,
Philip