home *** CD-ROM | disk | FTP | other *** search
- program Prgrscrn;
- (* A program in Turbo pascal to load and print a file saved with Microsofts
- PC-Paintbrush. Before running "Prgrscrn" you must have "Frieze.com"
- resident. So you don't forget, put it in the "Autoexec.bat" file.
-
- PC-Paintbrush copyright and trademark -- Microsoft Corporation
-
- Frieze.com copyright and trademark -- Z-Soft Corporation
-
-
- Program written by : Claude C. Shaw
-
- With consultation from : Robert E. Palla *)
-
-
- Type
- Regset=Record case Integer of
- 1: (AX,BX,CX,DX,BP,DI,SE,DS,ES,Flags: Integer);
- 2: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
- end;
- anystr = string[255];
-
- var
- Regs : Regset;
- filename : string[80];
- goodfile : boolean;
- infile : file;
-
- function int10(callno,argument:byte;segment,offset:integer): integer;
- begin
- with Regs do
- begin
- AH:=75;
- CL:=callno;
- AL:=argument;
- ES:=segment;
- BX:=offset+1; (* Offset plus one to ignore string count. *)
- Flags:=0;
- Intr($10,Regs);
- end;
- end;
-
- procedure print_graphics_screen(filnam: anystr);
- var
- result : integer;
- arry : array[1..4] of integer;
- options : string[80];
-
- begin
- graphmode;
- palette(0);
- (* This works if picture was created with PC-Paintbrush in Medium resolution.
- If using HiRes change first line in this procedure to HIRES mode and
- delete second line. This procedure could be made more generic if another
- argument is added to 'print_graphics_screen' procedure to toggle Hi or
- Medium resolution. *)
- (* read window *)
- result := int10(1,0,seg(filnam),ofs(filnam));
- (* print window *)
- result := int10(0,1,0,0);
- textmode;
- end;
-
- (* Begin main routine *)
-
- (* This calls the procedure 'print_graphics_screen' and needs
- the file name and and extension of '.PCX' (default extension
- given to files done by PC-Paintbrush and accessed by Frieze).
- The file name must be followed by a '$0'. This signifies the
- end of the file name to the program Frieze. *)
-
- begin
- repeat
- clrscr;
- write('Input filename(must include ".PCX" extent --> ');
- readln(filename);
- assign(infile,filename);
- (*$I-*)
- reset(infile);
- (*$I+*)
- goodfile := (IOresult = 0);
- if not goodfile then
- begin
- write(chr(7));
- writeln('FILE ',filename,' NOT FOUND');
- delay(3000);
- end;
- until goodfile;
-
- print_graphics_screen(filename+chr(0)); (* picture file name followed by $0 *)
-
- end. (* All done. Goodbye. *)