HP3000-L Archives

July 1996, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
John Korb <[log in to unmask]>
Reply To:
John Korb <[log in to unmask]>
Date:
Thu, 25 Jul 1996 01:09:59 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (70 lines)
Frank wrote:
 
>Please give me escape sequences setting HP 700/92 terminals in 132 columns
>and back in 80 columns mode. Who knows the sequence and intrinsic call in
>Pascal detecting whether the setting was successful, and returns whether
>current setting is 80 or 132 columns.
 
I've got a few programs that play around with the REFLECTION display, and
while I'm on vacation this week and don't have access to the listings, I can
describe the method I used to determine the screen dimentions.  I would
imagine that the method should work for almost any HP terminal back to the
HP2640B.
 
 
Turn echo off (FCONTROL 13?).
Suppress automatic carriage return/line feed (FSETMODE something).
Set read timeout on $STDIN (FCONTROL 4?) to something like 10 seconds.
FWRITE to $STDLIST "Sense Absolute Cursor Position" (Esc,a) using CCTL 208.
FREAD from $STDIN the cursor position string.
Save the cursor position string as "Screen End Address".
FWRITE to $STDLIST "Home Cursor","Cursor Left","Sense Absolute Cursor Position"
   (Esc,H,Esc,D,Esc,a) using CCTL 208.
FREAD from $STDIN the cursor position string.
Enable automatic carriage return/line feed (FSETMODE something).
Turn echo on (FCONTROL 12?).
Extract the row and column coordinates from the cursor position string (I
   think REFLECTION and HP terminals send ESC "&a079c023R" when in 24x80 display
   mode.  The number before "c" is the column number, the number before "R" is
   the row number.  The row and column numbers are zero-based.)
If the screen dimensions are what you need then
   FWRITE to $STDLIST the "Screen End Address" string using CCTL 208.
   Set a flag to indicate that the screen mode DOES NOT need to be changed upon
      exit.
Else
   Save the information obtained so the screen can be returned to its previous
      dimensions when you are done.
   Change the screen dimensions to what you desire.
EndIf
 
 
The trick to the above is very simple.  By moving the cursor to the top left
corner of the screen, the cursor is moved to screen coordinate 0,0.  Moving
the cursor left one position causes the cursor to wrap around to the very
last position of the screen, row 23, column 70 in a 24x80 display, row 23,
column 131 in a 24x132 display, row 47, column 131 in a 48x132 display, etc.
I've used the method mostly with REFLECTION when I needed to go from a 24x80
to a 48x132 or 60x132 display for some very complex output format.
Personally, unless you are running REFLECTION on a PC with a 17" monitor,
I'd stay away from displays with more elements that 24x132 - unless you like
eyestrain.  I also remember a quirk caused by the carriage return/line feed
that occurs after the FREADs.  I know FSETMODE came into play, but I don't
remember the option.  You can probably find the option in the intrinsics
manual.
 
I know that in later revisions of the program I took the absolute cursor
addressing and converted it over to screen relative addressing, but the
above is simpler and gets the job done.
 
Hope the above helps.  I'll be back in the office the middle of next week.
If you contact me then, I can dig into the source and find all the little
quirks.
 
John
--------------------------------------------------------------
John Korb                            email: [log in to unmask]
Innovative Software Solutions, Inc.
 
The thoughts, comments, and opinions expressed herein are mine
and do not reflect those of my employer(s), or anyone else.

ATOM RSS1 RSS2