home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PRGRSCRN.ZIP / PRGRSCRN.PAS
Encoding:
Pascal/Delphi Source File  |  1986-03-18  |  2.7 KB  |  93 lines

  1. program Prgrscrn;
  2. (* A program in Turbo pascal to load and print a file saved with Microsofts
  3.    PC-Paintbrush. Before running "Prgrscrn" you must have "Frieze.com"
  4.    resident. So you don't forget, put it in the "Autoexec.bat" file.
  5.  
  6.    PC-Paintbrush copyright and trademark -- Microsoft Corporation
  7.  
  8.    Frieze.com    copyright and trademark -- Z-Soft Corporation
  9.  
  10.  
  11.                   Program written by :     Claude C. Shaw
  12.  
  13.                   With consultation from : Robert E. Palla             *)
  14.  
  15.  
  16.   Type
  17.       Regset=Record case Integer of
  18.               1: (AX,BX,CX,DX,BP,DI,SE,DS,ES,Flags: Integer);
  19.               2: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
  20.              end;
  21.       anystr = string[255];
  22.  
  23.   var
  24.     Regs            : Regset;
  25.     filename        : string[80];
  26.     goodfile        : boolean;
  27.     infile          : file;
  28.  
  29. function int10(callno,argument:byte;segment,offset:integer): integer;
  30.     begin
  31.       with Regs do
  32.        begin
  33.         AH:=75;
  34.         CL:=callno;
  35.         AL:=argument;
  36.         ES:=segment;
  37.         BX:=offset+1; (* Offset plus one to ignore string count. *)
  38.         Flags:=0;
  39.         Intr($10,Regs);
  40.        end;
  41.     end;
  42.  
  43. procedure print_graphics_screen(filnam: anystr);
  44.  var
  45.   result          : integer;
  46.   arry            : array[1..4] of integer;
  47.   options         : string[80];
  48.  
  49.  begin
  50.   graphmode;
  51.   palette(0);
  52.   (* This works if picture was created with PC-Paintbrush in Medium resolution.
  53.      If using HiRes change first line in this procedure to HIRES mode and
  54.      delete second line. This procedure could be made more generic if another
  55.      argument is added to 'print_graphics_screen' procedure to toggle Hi or
  56.      Medium resolution. *)
  57.   (* read window *)
  58.   result := int10(1,0,seg(filnam),ofs(filnam));
  59.   (* print window *)
  60.   result := int10(0,1,0,0);
  61.   textmode;
  62.  end;
  63.  
  64.             (* Begin main routine *)
  65.  
  66.             (*   This calls the procedure 'print_graphics_screen' and needs
  67.                the file name and and extension of '.PCX' (default extension
  68.                given to files done by PC-Paintbrush and accessed by Frieze).
  69.                The file name must be followed by a '$0'. This signifies the
  70.                end of the file name to the program Frieze.                  *)
  71.  
  72.  begin
  73.   repeat
  74.    clrscr;
  75.    write('Input filename(must include ".PCX" extent --> ');
  76.    readln(filename);
  77.    assign(infile,filename);
  78. (*$I-*)
  79.    reset(infile);
  80. (*$I+*)
  81.    goodfile := (IOresult = 0);
  82.    if not goodfile then
  83.     begin
  84.      write(chr(7));
  85.      writeln('FILE ',filename,' NOT FOUND');
  86.      delay(3000);
  87.     end;
  88.    until goodfile;
  89.  
  90.   print_graphics_screen(filename+chr(0)); (* picture file name followed by $0 *)
  91.  
  92.  end.       (* All done. Goodbye. *)
  93.