Re: SHELL alternative

 BBS: Inland Empire Archive
Date: 03-06-92 (00:06)             Number: 171
From: LOGAN ASHBY                  Refer#: NONE
  To: TIM FITZGERALD                Recvd: NO  
Subj: Re: SHELL alternative          Conf: (11) Modula-2

In a msg of <04 Mar 92>, Tim Fitzgerald writes: LA>> ???? Not sure what 'complete control over the screen' involves. LA>> Care to give a few more details, like what your to trying to do LA>> with the screen, etc...? TF > Certainly.. When I SHELL out, I want to suppress ALL output from the TF > called program. At this point, I can suppress some it by just piping Oh... OK. You know, 3 weeks ago I was firmly convinced there was no way to do this. Then I downloaded a message that showed exactly how to do it. That's what I love about this Echo; the people in here think dang near anything can be done with QB, ... and can back it up with code!!! Credit for the principles behind this routine goes to Craig Nelson, from Oz. He posted code showing how to make the CRTC (Cathode Ray Tube Controller) chip start displaying at different offsets in video memory, without telling your computer. Neat trick, huh? - - - - - - - - cut here - - - - - - - - ' This the address of the CRT Controller's index register select CONST CRTCindex = &H3D4 ' This is the address where variables go into the CRT Controller's ' registers CONST CRTCdata = &H3D5 ' This is the high byte of the start address register CONST startaddrhi = &HC ' This is the low byte of the start address register CONST startaddrlow = &HD CLS '| Go thru video pages printing '| the current message and pg# PRINT "This is where its happening, man!!!" FOR i% = 1 TO 6 SCREEN ,,i%,i% CLS PRINT "Welcome to Screen Page"; i% PRINT "All the Actions on Page 0 :-)" NEXT i% SCREEN ,,7,7 CLS PRINT "Welcome to waiting room #7." PRINT "Take a seat, we'll be right with you." SCREEN ,,0,0 '| Reset active page for output OUT CRTCindex, startaddrhi '| Set chip for page 8 OUT CRTCdata, &H38 '| Each page is &H800 bytes long OUT CRTCindex, startaddrlow '| in 80x25 text modes. OUT CRTCdata, &H00 SHELL "LHA E TESTLHA" '| Run program (LHARC is very '| bad about outputting msgs '| where you don't want them.) SCREEN ,,7,7 '| Go back and tell you when we're PRINT "Hey Slick, stuff is all done!!" '| finished PRINT "Hit <ENTER> till you get to it." INPUT KEY$ '| Wait for key FOR i% = 6 TO 0 STEP -1 '| Walk backwards thru pages OUT CRTCindex, startaddrhi '| displaying messages left OUT CRTCdata, (&H08 * i%) '| earlier. OUT CRTCindex, startaddrlow OUT CRTCdata, &H00 INPUT KEY$ NEXT i% SCREEN ,,0,0 '| Show where the output was done END - - - - - - - - cut here - - - - - - - - Now, all this can do is show a static display and make sure that your child process doesn't output all over your nice screen. As far as building a window to display messages in while the child is running, I still haven't figured that out. ...But I'm working on it. :-) One note of caution though: the Wizard Nelson said to be VERY careful with this chip, because it contains many more registers than we're playing with here, and some of the unused ones are best left alone. I seem to remember reading somewhere that they can actually do damage to your hardware if not treated with the proper respect!!! seeya, Logan --- GoldED 2.31p * Origin: Now, where did I put that desk formatter? (1:398/1.2)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET