×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Screen displays incorrectly with coded vs manual inputting
3

Screen displays incorrectly with coded vs manual inputting

Screen displays incorrectly with coded vs manual inputting

(OP)
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

RE: Screen displays incorrectly with coded vs manual inputting

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..

RE: Screen displays incorrectly with coded vs manual inputting

Sess.Screen.PutString "A string", row_num, col_num

RE: Screen displays incorrectly with coded vs manual inputting

I would also suggest using the Putstring method of the Screen Object.

RE: Screen displays incorrectly with coded vs manual inputting

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.  

Quote:


** 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?

RE: Screen displays incorrectly with coded vs manual inputting

(OP)
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

RE: Screen displays incorrectly with coded vs manual inputting

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!

RE: Screen displays incorrectly with coded vs manual inputting

You may want to check out the FAQ sections.

Calculus

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close