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!

"Screen Read Function" or similar code to find end of text?

Status
Not open for further replies.

Undisclosed

Technical User
Apr 4, 2004
1
CA
Hi everyone I'm new to writing macros.

A macro I have been trying to code for quite some time is as follows:

With every addition to the notes of a file I must Page Down, Page Down several times to find the last line where I can begin to write. Here the word "several" should not be underestimated, the Page Down Key is starting to fade as well as many brain cells who simply can't bear with the monotomy.

So I've been experimenting with the screen read function and other funcitons with little success. Given that that it is the last blank line immediately preceded by a line (above it) of "============" could anyone suggest a script to move the cursor to the end?

Any solution would be tremediously appreciated
 
You've not given me enough specifics to give you a specific solution, but here are some thoughts.

If the only time "============" appears, why not look for it, then position the cursor once it's found?

On version 6.5+, the function is
Sess0.Screen.GetString(Row,Col,Length)
(length is 12 in this case)

So,

Code:
Do

 For Row = [top row] to [bottom row]
  If Sess0.Screen.GetString(Row,Col,12) = "============" then
   'You've found your string, now position you cursor accordingly
   Exit Do
  End If
 Next Row

'Not on this page, hit page down
Sess0.Screen.SendKeys("<PageDown>")
     Do While Sess0.Screen.OIA.Xstatus <> 0
     'This will wait for the "X-Clock" to go away
     Loop
Loop

Also, check the FAQ:
I'm ready for Extra Basic... now what? faq99-4087

Hope this is on task,

calculus
 
Hi,

Hoping somebody can help.

I want to read a screen each time a new one is displayed looking for some fixed text on the screen and if it is found run some code.

Does Extra fire some sort of event each time a new screen is displayed which can then kick off or restart a macro?

Thanks

Andy
 
This is a cross post. Please use this thread...
thread1-1118340

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top