Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Editable Text Box Not Accepting variable value
#1
Greetings,

I am unable to populate an editable text box with data froma string variable.

Macro Get Cost Options
Code:
Copy      Help
,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
#2
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)
#3
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
Code:
Copy      Help
,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
#4
If a4.Select(1) does not set focus, use a4.Mouse(1)
Is it a str variable?
#5
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
#6
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
#7
Then key varVIN or paste varVIN must work. If doesn't, maybe varVIN is empty. Try to debug:
out varVIN
paste varVIN
#8
Thanks Gintaras, it's done.
Yes the varVIn was empty...
Best Regards,
Philip


Forum Jump:


Users browsing this thread: 1 Guest(s)