Good morning,
I have a system that uses the terminal type "VT220". A couple of reports that I offer the option of either display or printer require 132 columns to display. I use the ESC:"[?3h" command to do this expansion and it works fine. At the end of the report when I attempt to reset the display to 80 columns by issiuing the ESC:"[?3l" command it does not work. The screen stays in 132 column mode. Does anybody know how to get the screen back to 80 columns? The emulator is AccuTerm 8.
Thanks, Dale
Hi Dale,
I tend to use the AccuTerm commands to do this sort of thing rather than the emulated terminal settings. And AccuTerm lets you do things that "normal" terminals just can't do.
The essence of it is that AccuTerm has two "recognised" terminal sizes, but you can set those terminal sizes to anything you like (up to 240 x 240). If you look in the AccuTerm 'Screen' settings, you will see what your current settings are, and you can change the settings there. (FWIW, we haven't used "standard" screen dimensions for years - my typical screeen is set to 170 characters wide by 45 lines deep - and some reports will dynamically be set to larger dimensions than that).
You can switch between these settings using AccuTerm scripting ... and you can similarly change the dimensions of those two screens using AccuTerm scripting.
Cheers,
Brian
Good morning,
I have a system that uses the terminal type "VT220". A couple of reports that I offer the option of either display or printer require 132 columns to display. I use the ESC:"[?3h" command to do this expansion and it works fine. At the end of the report when I attempt to reset the display to 80 columns by issiuing the ESC:"[?3l" command it does not work. The screen stays in 132 column mode. Does anybody know how to get the screen back to 80 columns? The emulator is AccuTerm 8.
Thanks, Dale
Thanks Brian, your answers have been helpful to me on more than 1 occasion.
Dale
Good morning,
I have a system that uses the terminal type "VT220". A couple of reports that I offer the option of either display or printer require 132 columns to display. I use the ESC:"[?3h" command to do this expansion and it works fine. At the end of the report when I attempt to reset the display to 80 columns by issiuing the ESC:"[?3l" command it does not work. The screen stays in 132 column mode. Does anybody know how to get the screen back to 80 columns? The emulator is AccuTerm 8.
Thanks, Dale
I usually set up AccuTerm with more than the old 24 row screens. I wanted a way to set my Universe settings to match whatever columns and rows I had AccuTerm set to. I wrote a few routines to do that. Maybe you'll find them useful.
AccuTerm has two screen modes, normal and extended. Normal is the smaller number of columns and extended is the higher number. I have two programs that check the current mode and if it's different, sets it to the desired mode. I called the programs ATN and ATE for AccuTerm normal and extended.
Each program sends a script to AccuTerm to get the current mode, the number of columns and rows in that current mode. It then uses that information to set the Universe columns and rows to the actual number.
First there's the function that gets the screen size from AccuTerm:
FUNCTION GET.SCREEN.SIZE
* FUNCTION TO QUERY ACCUTERM AND RETURN THE SCREEN SIZE AS
* MODE,COLS,ROWS
* MODE=0 NORMAL, MODE= -1 EXTENDED COLUMNS
DEFFUN TIMED.INPUT(MILLISECONDS)
EQU ESC TO CHAR(27)
EQU STX TO CHAR(2)
EQU EM TO CHAR(25)
EQU CR TO CHAR(13)
* SEND VBA SCRIPT TO RETURN THE CURRENT COLUMNS AND ROWS
PRINT ESC:STX:'RWith ActiveSession':EM:'.Output .ScrMode & "," & .Cols & "," & .Rows & ChrW$(13)':EM:'End With':CR:
ECHO OFF
SAVED.PROMPT = SYSTEM(26)
PROMPT ''
*INPUT SCREEN.SIZE
SCREEN.SIZE = TIMED.INPUT(1000) ;* WAIT UP TO A SECOND FOR THE SIZE
PROMPT SAVED.PROMPT
ECHO ON
RETURN(SCREEN.SIZE)
The above sends a script to AccuTerm. The script sends back the string "mode,cols,rows". If the script is run from a non Accuterm session the script won't run and the program will hang waiting for the response from the script. That's the purpose of the TIMED.INPUT function. It waits for input for the passed in number of milliseconds and returns blank if nothing is entered. Here's that routine:
FUNCTION TIMED.INPUT(MILLISECONDS)
* FUNCTION TO GET INPUT FROM THE KEYBOARD BUT TIME OUT IF NOTHING COMES IN BY THE
* PASSED IN MILLISECONDS. THE INPUT CAN BE TERMINATED EARLY BY A CR OR LF
$OPTIONS TIME.MILLISECOND ;* TELL UNIVERSE TO RETURN THE RESULT OF SYSTEM(12) IN MILLISECONDS INSTEAD OF SECONDS.
CR = CHAR(13)
LF = CHAR(10)
START = SYSTEM(12)
WAIT.UNTIL = START + MILLISECONDS
RESULT = ''
LOOP
NAP 5 ;* PAUSE 5 MILLISECONDS SO THE LOOP ISN'T TOO TIGHT ON CPU TIME.
INPUT CHARS.WAITING, -1: ;* CHECK THE INPUT BUFFER. IF NONE, CHARS.WAITING = 0 ELSE 1
IF CHARS.WAITING THEN
Q = KEYIN() ;* GET THE RAW CHARACTER
IF Q = CR OR Q = LF THEN EXIT
RESULT := Q
END
NOW = SYSTEM(12)
* THE "NOW < START" CHECKS TO SEE IF THE SYSTEM TIME HAS ROLLED OVER AT MIDNIGHT
IF NOW > WAIT.UNTIL OR NOW < START THEN EXIT
REPEAT
RETURN (RESULT)
Finally there's the ATN command that sets AccuTerm to normal mode and uses the results of the GET.SCREEN.SIZE to change the TERM settings:
* PROGRAM TO SET THE SCREEN TO NORMAL AND ADJUST THE TERM SETTINGS BASED ON
* THE ACTUAL ACCUTERM SCREEN SIZE
DEFFUN GET.SCREEN.SIZE
EQU ESC TO CHAR(27)
EQU STX TO CHAR(2)
* PRINT THE ACCUTERM STRING TO SET NORMAL MODE
PRINT ESC:STX:"N":
SCREEN.SIZE = GET.SCREEN.SIZE()
COLS = FIELD(SCREEN.SIZE,',',2)
ROWS = FIELD(SCREEN.SIZE,',',3)
CMD = 'TERM ':COLS:',':ROWS
EXECUTE CMD CAPTURING JUNK
Here's the ATE version for extended mode:
* PROGRAM TO SET THE SCREEN TO EXTENDED AND ADJUST THE TERM SETTINGS BASED ON
* THE ACTUAL ACCUTERM SCREEN SIZE
DEFFUN GET.SCREEN.SIZE
EQU ESC TO CHAR(27)
EQU STX TO CHAR(2)
* PRINT THE ACCUTERM STRING TO SET EXTENDED MODE
PRINT ESC:STX:"E":
SCREEN.SIZE = GET.SCREEN.SIZE()
COLS = FIELD(SCREEN.SIZE,',',2)
ROWS = FIELD(SCREEN.SIZE,',',3)
CMD = 'TERM ':COLS:',':ROWS
EXECUTE CMD CAPTURING JUNK
Looking at this it would probably be cleaner just have a routine to call that gets the AccuTerm settings and adjusts the TERM settings to match. That would basically be this:
FUNCTION SET.TERM.TO.ACCUTERM
SCREEN.SIZE = GET.SCREEN.SIZE()
COLS = FIELD(SCREEN.SIZE,',',2)
ROWS = FIELD(SCREEN.SIZE,',',3)
CMD = 'TERM ':COLS:',':ROWS
EXECUTE CMD CAPTURING JUNK
Then just call it after setting extended or normal mode. (That's the problem with posting things. It always looks like you could do it better).
Anyway, maybe this will be useful.
Joe G.