[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

395.0. "SET-UP Display No-Scroll from a program?" by THEBUS::KOSTAS (Wisdom is the child of experience.) Tue Feb 03 1987 12:51

    Hello,
    
      I was wandering what is the system services routine which I need
    to call from Pascal to do the set-up display no-scroll, (or is it
    an escape sequence?).
    
    I need to be able to write to the screen using writelns of REGIS
    code without the screen scrolling on me.
    
    Could some one provide some info or a pointer to such info.
    
    Regards,
    
    Kostas G.
T.RTitleUserPersonal
Name
DateLines
395.1setting up scrolling regionsTOLEDO::VENNERTue Feb 03 1987 13:3011
    there is a run time library routine called SCR$SET_SCROLL
    which accepts two arguments, the starting and ending line
    of the scroll region that you want.  it expects the arguments
    to be passed by immediate value.
    
    if you're just using a VTXX terminal the actual escape sequence
    is <ESC>[5;10r for example (scrolling region using lines 5 thru
    10).
    
    - marty
    
395.2No-need for No-scroll.BISTRO::HEINIf We don't Have it,You don't Need it!Tue Feb 03 1987 17:1422
    SCR$Mumbles are out of fashion. You are supposed to use SMG$More_Mumbles.
    Anyway, setting up a scrolled region is most lickely to result in
    scrolling within the region as oposed to the desired no scrolling.
    
    The scrolling is caused by a (Carriage_Return) LineFeed output that
    PASCAL generates, and should generate, after output with WRITELN...
    IF the cursor is at the bottom of a scrolled region.
    
    So the solution is to
    
    	- Avoid the (CR and) LF through other pascal output statements:
    		Write ? Carriage control? Put? I don't know
    	- Avoid being at the bottom line be including an 'cursor up'
    	  escape sequence in the output line.
    	- This being the hackers file.... You could try puttin an
    	  ESCAPE as last output character. If pascal outputs an LF
    	  before the CR then that LF will be 'eaten' by the terminal
    	  as part of the presumed escape sequence. This is my favourite
    	  way of 'eating' the "?" at the end of a BASIC INPUT statement.
    
    Hein.
    
395.3Or you could rewrite it in a high-level language like DCLMAY13::MINOWMartin Minow, MSD A/D, THUNDR::MINOWTue Feb 03 1987 19:1314
    	- This being the hackers file.... You could try puttin an
    	  ESCAPE as last output character. If pascal outputs an LF
    	  before the CR then that LF will be 'eaten' by the terminal
    	  as part of the presumed escape sequence.

Say what?  According to the escape sequence parsing spec, the LF
terminates the pending escape sequence, throwing it away.  I.e.,
<ESC><LF> should be equivalent to just <LF>.

I kind of like the hackish solution of putting a cursor up at the end
of the line.  It appeals to the cynic in me.

Martin.

395.4That annoying '?'AMIGO::MULLENDan MullenTue Feb 03 1987 22:2712
RE: .2
>    	- This being the hackers file.... You could try puttin an
>    	  ESCAPE as last output character. If pascal outputs an LF
>    	  before the CR then that LF will be 'eaten' by the terminal
>    	  as part of the presumed escape sequence. This is my favourite
>    	  way of 'eating' the "?" at the end of a BASIC INPUT statement.

FYI: 
	VAX BASIC has a SET NO PROMT ro enable/disable the question mark.

..Dan
395.5WRITELN needed for I/OWHOARU::MCCARTHYJust another colorful metaphorWed Feb 04 1987 01:2311
    re: .2
    	Pascal does no terminal I/O until a WRITELN is issued.  If you
    do several writes, without a WRITELN, you will exceed some limit
    (I forget which one...you get an error like "line to long....")
    
    	I would go for the SGM stuff.  Lib$set_scroll still works (I
    think) and that is what I used to use.  You can set the scroll region
    to one line ( can't you?) and then use ESC sequences to output into
    other areas within the WRITELN.
    
    mac (still a pascal hacker,,,,,BLISS who needs it !)
395.6BISTRO::HEINIf We don't Have it,You don't Need it!Wed Feb 04 1987 07:2126
    Re .3,
    	Thanks Martin for correcting me on that one. I blindly assumed
    	that as <ESC> "?" is 'eaten', so would all other invalid char-
    	acters ( more or less all but "[" ) dissappear. I had not 
    	realized the the LF terminates the escape sequences. (I did
    	realize the CR might terminate the ESC, and I realized that
    	if that even if the CR goes away, then the LF will still cause
    	the scroll. So I wrote LF CR. But in reality most, or all,
    	languages really use <CR> <LF> in that order to terminate the
    	line)

    Re .4,
    	
    	The SET NO PROMPT is new with BASIC V3.0
    
    Re .5,
    
    	I still maintain that the solution is to avoid the scroll, not
    	to turn it into something harmless. *Surely* there is some way
    	in PASCAL to avoid the CR LF at the end of the line. One way
    	seems to be to use the FORTRAN type CARRIAGE CONTROL attribute
    	for the file and put a "$" as first character on the line.
    	Other ways are including a relative or absolute cursor address
    	in the output line ( eg ESC [ A for up or ESC [ H for Home.
    
    Hein.
395.7The pocket reference is mute on this topicANYWAY::GORDONAll I ever do is work &amp; shovel snow!Wed Feb 04 1987 12:0011
    	Well, when I read .0, I thought he was after the escape sequence
    to set a VT240/241 to No Scroll, so I looked in my pocket reference.
    Alas, the pocket reference only includes Jump Scroll and Smooth
    Scroll, but not No Scroll.
    
    	If you set the scrolling region on the terminal to only line 24,
    no scrolling will occur of the other 23 lines, but you lose the
    24th line.  Why don't you just use terminal QIO's to write to the
    terminal with no carriage control?
    
    					--Doug
395.9nitJON::MORONEYLegalize LibertyWed Feb 04 1987 15:4813
re .2, .3, .6:

  Control characters like <LF> and <CR> do not terminate an escape sequence,
rather they're interpreted immediately and then the escape sequence continues
to add characters as if the control character never existed. An exception to
this is another <ESC> character, which terminates the previous sequence without
action and starts a new one.  If you don't believe this, try writing the
following to your terminal: (Use EXTR TT:)

a blank line follows this line
[
4munderlined text[m

-Mike
395.10SET PROMPT = BASIC 3.0FROST::HARRIMANWorkin' in the Code MinesWed Feb 04 1987 16:557
    Re: Martin et al
    
       SET PROMPT is only good on 3.0 BASIC.. For us poor slobs who
    are "stuck" with 2.4 BASIC, I like Martin's hack... Of course, I
    just got around all of that by using LIB$GET_INPUT....
    
    /pjh
395.11Oh, yeah, BTWFROST::HARRIMANWorkin' in the Code MinesWed Feb 04 1987 17:0516
    Oh yeah, I forgot about this too:
    
    Try the following on any BASIC:
    
    1	Open "TT:" for input as file #1%
    
    	Input #1%, "Foo: ";Bar$
    
    	Print bar$
    
    	End
    
    
    	Where's the "?"	?
    
    /pjh
395.12CAFEIN::PFAUYou can't get there from hereWed Feb 04 1987 20:494
    There's always GET #0 - MOVE FROM #0.  This does away with the '?'
    but doesn't reprint a prompt on a ^R or ^U.
    
    tom_p
395.13no need for this hack in CPLDVAX::ZARLENGABigger they are, Harder they hitTue Feb 10 1987 22:205
    	We got around it by doing ^M, ESC, M.  ^M to position cursor
    at beginning of current line, ESCM to do reverse index (shorter
    than cursor-up which is ESC[A by 1 character).
    
    -mike zarlenga
395.14CAFEIN::PFAUYou can't get there from hereWed Feb 11 1987 00:147
    Shorter, yes, but with different affects (effects?).  ESC M (reverse
    index, RI) will cause the screen to scroll down if at the top line,
    ESC [ A (cursor up, CUP) will not.  If this doesn't make a difference
    (if you know you won't be writing to the top line of the screen),
    use RI.
    
    tom_p
395.15Tip on hacking English :-)ERIS::CALLASSo many ratholes, so little timeThu Feb 12 1987 20:054
    Effects. The way to tell the difference is that "effect" is a noun
    and "affect" is a verb.
    
    	Jon
395.16^X cancels escape sequenceDELNI::CANTORDave C.Sat Apr 11 1987 18:4710
      Re .9
      
      Another control character which terminates an escape sequence
      without action is the cancel character (CAN, control-X), which
      terminates the escape sequence and doesn't start a new one. 
      
      Another way of looking at, I guess, is that CAN terminates
      a no-op escape sequence.
      
      Dave C.
395.17I'm surprizedMDVAX3::COARA wretched hive of bugs and flamers.Wed Dec 02 1987 16:098
    Tch, tch.  Didn't anyone else read Stoney Ballard's DND sources?
    If you want to avoid appending a <CR><LF> to your WRITELNs, use
    the OPEN procedure with (something like) CARRIAGE_CONTROL := NONE.
    Open SYS$OUTPUT as another file, and specify that file in the WRITEs
    and WRITELNs when you are doing ReGIS.  Omit it for normal text,
    and the <CR><LF> will appended to the text.
    
    #ken_who_thinks_everybody_missed_the_point	:-)}