Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Archive » net.micro.cpm » Turbo Pascal output
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Turbo Pascal output [message #112411] Mon, 16 September 2013 13:43 Go to next message
mdf is currently offline  mdf
Messages: 19
Registered: June 2013
Karma: 0
Junior Member
Message-ID: <1230@trwrba.UUCP>
Date: Wed, 16-Jan-85 13:07:06 EST
Article-I.D.: trwrba.1230
Posted: Wed Jan 16 13:07:06 1985
Date-Received: Mon, 21-Jan-85 02:11:16 EST
Organization: TRW EDS, Redondo Beach, CA
Lines: 10


Is there a method that enables program output to be sent
to the screen and printer??? Cntrl-P works when running
CPM, but from Turbo Pascal, it doesn't. (at least not on
my machine.)  Do I make the program a .COM file and use Cntrl-P??
Thanks in advance for any help given.
           Mark Falleroni
           TRW
           Ogden,Ut.
           (mdf)
Re: Turbo Pascal output [message #113916 is a reply to message #112411] Tue, 17 September 2013 14:58 Go to previous messageGo to next message
db21 is currently offline  db21
Messages: 19
Registered: May 2013
Karma: 0
Junior Member
Message-ID: <864@ihuxk.UUCP>
Date: Wed, 23-Jan-85 07:06:14 EST
Article-I.D.: ihuxk.864
Posted: Wed Jan 23 07:06:14 1985
Date-Received: Thu, 24-Jan-85 07:01:13 EST
References: <1230@trwrba.UUCP>
Organization: AT&T Bell Labs, Naperville, IL
Lines: 31


 >  Subject: Turbo Pascal output
 > 
 >  Is there a method that enables program output to be sent
 >  to the screen and printer??? Cntrl-P works when running
 >  CPM, but from Turbo Pascal, it doesn't. (at least not on
 >  my machine.)  Do I make the program a .COM file and use Cntrl-P??
 >  Thanks in advance for any help given.
 >           Mark Falleroni
 >           TRW
 >           Ogden,Ut.
 >           (mdf)
 > 
	In order to print output to both the screen and the line
printer in Turbo Pascal under CP/M you must include a second
writeln statement which directs its output to the Lst device.
For example, to print the string 'Hello There!' on both the
screen and printer, you would include the following lines in
your program:

	writeln ('Hello There!'); { print on screen }
	writeln (Lst,'Hello There!'); { print on printer }

	This is discussed beginning in section 14.5, Text Files,
of my Turbo manual.  There is a program with examples in 
section 14.5.1, and a description of the logical devices given
in section 14.5.2.

					Dave Beyerl
					ihuxk!db21
					AT&T Bell Labs, Naperville, IL
Re: Turbo Pascal output [message #113918 is a reply to message #112411] Tue, 17 September 2013 14:58 Go to previous messageGo to next message
hunterj is currently offline  hunterj
Messages: 3
Registered: September 2013
Karma: 0
Junior Member
Message-ID: <348@utai.UUCP>
Date: Thu, 24-Jan-85 19:01:50 EST
Article-I.D.: utai.348
Posted: Thu Jan 24 19:01:50 1985
Date-Received: Thu, 24-Jan-85 20:01:26 EST
References: <1230@trwrba.UUCP> <864@ihuxk.UUCP>
Reply-To: hunterj@utai.UUCP (James Hunter)
Organization: CSRI, University of Toronto
Lines: 42
Summary: 

In article <864@ihuxk.UUCP> db21@ihuxk.UUCP (Dave Beyerl) writes:
 > 
 >>  Subject: Turbo Pascal output
 >> 
 >>  Is there a method that enables program output to be sent
 >>  to the screen and printer??? Cntrl-P works when running
 >>  CPM, but from Turbo Pascal, it doesn't. (at least not on
 >>  my machine.)  Do I make the program a .COM file and use Cntrl-P??
 >>  Thanks in advance for any help given.
 >> 
 > 	In order to print output to both the screen and the line
 > printer in Turbo Pascal under CP/M you must include a second
 > writeln statement which directs its output to the Lst device.
 > For example, to print the string 'Hello There!' on both the
 > screen and printer, you would include the following lines in
 > your program:
 > 
 > 	writeln ('Hello There!'); { print on screen }
 > 	writeln (Lst,'Hello There!'); { print on printer }
 > 

  Or, you could write a procedure to print to both the console and the printer:

  type
    workstring = string[255];


   procedure both(stuff: workstring);
   begin
	writeln(stuff);
	writeln(LST,stuff);
   end;

  You may want to use the compiler directive {$V-} with this which relaxes
parameter checking and allows parameters of any string length to be passed.
{See section 16.1.1 of manual about this}.
The problem with this approach is that you may want to print both strings
and numbers, which won't be automatically formatted as with the writeln
command.

---------------------
  Gumby lives!!
Re: Turbo Pascal output [message #113956 is a reply to message #112411] Tue, 17 September 2013 14:58 Go to previous message
smereski.wbst[1][2] is currently offline  smereski.wbst[1][2]
Messages: 2
Registered: September 2013
Karma: 0
Junior Member
Message-ID: <7725@brl-tgr.ARPA>
Date: Sat, 26-Jan-85 11:27:58 EST
Article-I.D.: brl-tgr.7725
Posted: Sat Jan 26 11:27:58 1985
Date-Received: Wed, 30-Jan-85 06:30:12 EST
Sender: news@brl-tgr.ARPA
Organization: Ballistic Research Lab
Lines: 80

Re:
----------------------------------------------------------
 >>  Subject: Turbo Pascal output
 >> 
 >>  Is there a method that enables program output to be sent
 >>  to the screen and printer??? Cntrl-P works when running
 >>  CPM, but from Turbo Pascal, it doesn't. (at least not on
 >>  my machine.)  Do I make the pr^ram a .COM file and use Cntrl-P??
 >>  Thanks in advance for any help Oiven.
 >>           Mark Faleroni
 >>           TRW
 >>           Ogden,Ut.
 >>           (mdf)
 >> 
 >         In order to print output to both the screen and the line
 > printer in Turbo Pascal under CP/M you must include a second
 > writeln statement which directs its output to the Lst device.
 > For example, to print the string 'Hello There!' on both the
 > screen and printer, you would include the following lines in
 > your program:
 > 
 >         writeln ('Hello There!'); { print on screen }
 >         writeln (Lst,'Hello There!'); { print on printer }
 > 
 >         This is discussed beginning in section 14.5, Text Files,
 > of my Turbo manual.  There is a program with examples in 
 > section 14.5.1, and a description of the logical devices given
 > in section 14.5.2.
 > 
 >                                         Dave Beyerl
 >                                         ihuxk!db21
 >                                         AT&T Bell Labs, Naperville, IL
 > 
----------------------------------------------------------------


Because of the good documentation and careful construction of Turbo-Pascal
it is possible to make it do almost anything you wish.  For instance if
you really want to echo all console output to the printer the following
program will do it.  The information needed to set it up can be found in 
the Turbo Pascal manual in section A.12 for CPM systems and B2.3 for 8086
based systems.

         Program ControlpTest;
         
         Var
            Ch : Char;
            SaveAddress : Integer;

         Procedure PWrite (Ch : Char);
         Var
            CB : Byte Absolute Ch;
         
         Begin {PWrite}
         Bios (4, CB);
         Bios (3, CB);
         End; {PWrite}
         
         
         Begin {ControlpTest}
         SaveAddress := ConOutPtr;      {Save address of default routine}
         ConOutPtr := Addr (PWrite);    {turn on printer echo}   
         Read (Kbd, Ch);
         While Ch <> ^Z Do              {test the echo until control-Z}
            Begin
            Write (Ch);
            Read (Kbd, Ch);
            End;
         ConOutPtr := SaveAddress;      {turn off printer echo}
         End.

If you really want to simulate control-P in all its glory then simply patch
into the console input routine in a similar fashion (ConInPtr := address of
your own Procedure).  Your procedure can then scan all console input for a 
control-P and turn the echo on or off as shown above.

I hope this technique is useful to some of you.


/Dave
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: MDM730 Overlay for Ithaca Intersystems VIO board with 2661 USART
Next Topic: Re(3): File sizes from Turbo & directory
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Mar 29 01:33:39 EDT 2024

Total time taken to generate the page: 0.02096 seconds