Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Get current cursor position on terminal screen?
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedGet current cursor position on terminal screen?

 Post Reply Post Reply
Author
Message
accuterminal View Drop Down
Newbie
Newbie


Joined: June 02 2015
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote accuterminal Quote  Post ReplyReply Direct Link To This Post Topic: Get current cursor position on terminal screen?
    Posted: June 03 2015 at 7:37am
I'd like to grab data off the line where the user has the cursor
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: June 04 2015 at 9:58am
Hello -

Depending on the terminal emulation you are running you may be able to use an escape sequence to send the cursor line to the host. For example, Wyse 50/60 has an escape sequence to send the contents of the row where the cursor is positioned, from column 1 through the cursor location, back to the host with a CR at the end. This sequence is documented in the AccuTerm 7 Help, AccuTerm 7 Reference chapter, Wyse Programming topic, "Printer Control and Terminal Reports" section.

Otherwise you could use a script to read the screen text and send it back to the host. For example:
EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13), EM TO CHAR(25)
PRINT @(5,5):
SLEEP 1
SCRIPT = 'InitSession.Output InitSession.GetText(0) & Chr(13)'
PRINT ESC:STX:'P':SCRIPT:CR:
ECHO OFF; PROMPT ''
INPUT STUFF
ECHO ON; PROMPT '?'

In the GetText() method, the "0" is the starting column. The other arguments are missing, using the defaults of "current row", "last column" and "all text".

Thanks,

Pete
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.