Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PutString into a single character field not working...

Status
Not open for further replies.

TheMarmosetKing

Programmer
Aug 11, 2006
4
US
I'm trying to automate data entry. I can use Sess.PutString all day long to enter text, but when I get to a single character field, such as a person's middle initial, nothing happens. Can anyone help me out with this?
 
Can you show us some code?

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Sure thing, but I'm not sure how much it will help. Here is the bit that isn't working right:

...
xScreen.PutString "Newname", 14, 19 ' Works fine
xScreen.PutString "first", 15, 19 ' Works fine
xScreen.PutString "m", 15, 44 ' Does nothing
...

Please bear in mind that today is my first exposure (literally) to scripting on Extra! and this is exactly what my code looks like for now.

By the way, I found a workaround until I understand the problem. Using MoveTo followed by SendKeys works fine, but I'd still like to understand what isn't working right.
 
Do you have 44 columns on your screen?

Is 15, 14 a protected field on your screen?
try clearing your screen and xScreen.PutString "m", 1, 1

The MoveTo is working on 15, 44 ?

Your syntax is correct and should be working


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
No, the field is not protected and there are a total of 80 columns.

The MoveTo works just fine, fortunately.

I had already tried starting with a clear screen, but that didn't work either.

I'm really not sure what the problem with it is, but at least I have a workaround. Thanks for trying to help! :)
 
I've had to use the MoveTo with SendKeys in a few instances where PutString wouldn't work. I believe the issue has to do with how the tab stops are set. If it's the same issue, you will find that smoething like this will work correctly:
xScreen.PutString "first" & "<Tab>" & "m", 15, 19

But, I'd rather use the MoveTo and SendKeys so I know exactly where the information is going.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top