home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG017.ARC
/
SCR_PRIN.INC
< prev
next >
Wrap
Text File
|
1979-12-31
|
1KB
|
45 lines
Program Screen or Printer;
{To use this procedure in a program you need to do several things. }
{1. In the main VAR list you must add the statement }
Q:TEXT;
{2. In the program all WRITE or WRITELN statements must start }
{ like the following .... }
{ Writeln(Q, ..... }
{ If you omit the Q, then the computer will automatically }
{ send the output to the screen. Only the statements which }
{ include the Q, will give you the choice of screen or printer. }
{3. The procedure must come before the main program BEGIN .. }
{ ..... END. block. }
{4. The procedure is called by simply writing its name in the }
{ main program. }
Procedure Device;
Var Dev:char;
Begin
writeln('Which output device ? .. S<creen> or P<rinter> ? ');
repeat
read(dev);
writeln;
if not (dev in ['s','p','S','P']) then
begin
writeln(upcase(dev));
writeln('An "S" or a "P" expected. Try again.');
end;
until dev in ['S','s','p','P'];
case dev of
's','S' : assign(Q,'CON:');
'p','P' : assign(Q,'LST:')
END; {CASE OF}
rewrite(Q);
end;{Procedure device}