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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen displays incorrectly with coded vs manual inputting 3

Status
Not open for further replies.

zzz789

Programmer
Apr 10, 2007
3
ZA
Hello,

Any help with the frustrating problem I am facing will be most welcome. The code that is written takes values from an excel spreadsheet and inputs to screen (on users app.).

The code works fine (taking values from respective cells as required and outputting) up until a certain point where the data is then incorrectly outputted to screen. If the sequence of steps are performed manually the output is correct; the same sequence in the coded version however, results in a different output.

As mentioned, this behaviour occurs at a certain point. On screen prior to entry via code the screen displayed is as:

** Repeatable Sequence 002 * * * * * * * * * *
Date/Time *98 :: / /
** Repeatable Sequence 002 * * * * * * * * * *
Date/Time *98 :: / /


Once the dates from excel are inputted the screen should display as follows (it does so when typed manually)

** Repeatable Sequence 002 * * * * * * * * * *
Date/Time *98 A:: SETT // 20070410
** Repeatable Sequence 002 * * * * * * * * * *
Date/Time *98 A:: TRAD // 20070409

the sequence was ....asett<Tab>date<Tab>atrad<Tab>date<14 further Tabs>


what does output (via code) to the screen is the following:

** Repeatable Sequence 002 * * * * * * * * * *
Date/Time *98 A:: SETT // 20070410 ATRAD
** Repeatable Sequence 002 * * * * * * * * * *
Date/Time *98 2:: 007 / / (cant remember this line - something similar)


I am completely stumped any sequence of changes to the number of tabs etc results in the same output.
Admittedly this is my first attempt at working with Extra, so hopefully this is a small problem and easily solvable (fingers crossed).

Thanks in advance for any help
 
ZZZ789,

I am naturally suspicious of using <TAB> when I'm coding. I find it leaves too much to chance. Plus, it takes up a lot of room in the code to tab through a bunch of fields before you get where you want to be.

Have you considered using a MoveTo statement to make sure that your cursor is in the right spot before executing the SendKeys statement?

Sess0.Screen.MoveTo xcoord, ycoord
Sess0.Screen.SendKeys("asett" & date)

xcoord and ycoord represent the spot on the screen where you want the first "a" to appear.

Good luck..
 
I would also suggest using the Putstring method of the Screen Object.
 
Here's why I suggested a combination of MoveTo and SendKeys rather than PutString.

Looking at the screen shots in the original post, it appeared to me that the information being sent to the screen was breaking over several fields, with the first field being only one character wide.

** Repeatable Sequence 002 * * * * * * * * * *
Date/Time *98 A:: SETT // 20070410
** Repeatable Sequence 002 * * * * * * * * * *
Date/Time *98 A:: TRAD // 20070409

the sequence was ....asett<Tab>date<Tab>atrad<Tab>date<14 further Tabs>

If ZZZ789 does

Code:
Sess0.Screen.PutString "asett", x, y

then all that will show up on the screen is the "a". The rest will get lost.

If ZZZ789 does

Code:
 Sess0.Screen.MoveTo x, y
Sess0.Screen.SendKeys("asett")

then "a" will show up in the first field, and "sett" will carry into the next field.

ZZZ789, what did you end up doing to solve the problem?

 
Thanks WinblowsMe, n554386 and especially lmbayley for the replies.

Unfortunately I've been caught up with another exercise (aka crises)and haven't had time to try and remedy the Extra problem with the suggestions given here. I am hoping to look at this problem either Thursday, or next week sometime and will then promptly give feedback.

This may be a silly question lmbayley, but how do I determine the xcoord and ycoord i.e the position of where I want to send the text to.

Thanks again
 
Put your cursor where you want the text to go, and have a look at the lower right-hand corner of your screen. Do you see two numbers separated by a forward slash? The first number is the row the cursor is on, and the second number is the column.

In the MoveTo and PutString statements, row comes first, then column:

Sess0.Screen.MoveTo RowNumber, ColumnNumber

-or-

Sess0.Screen.PutString "string", RowNumber, ColumnNumber

So, really, my examples above should have shown ycoord before xcoord if you're thinking in terms of x (horizontal) and y (vertical) axes. Sorry if that caused you any confusion!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top