PROCEDURE ask_x(VAR done,font_f_open,out_f_open : BOOLEAN; old_ff,old_of : S14); {f/exiting to input} VAR err : INTEGER; bit_rec : BIT_RECORD; BEGIN IF (sign = Banner) AND (((font_height * mult_h) + given_offset) > avail_chars) THEN BEGIN done := FALSE; GOTORC(20,40); WRITE('Banner is too big to fit on output!'^G) END ELSE BEGIN {is banner height ok?} done := TRUE; IF out_f_open AND (output_device <> recd_file) THEN BEGIN {$I-} CLOSE(out_file); {$I+} {close old file} err := IORESULT; IF err <> 0 THEN BEGIN out_fn := '????'; GOTORC(20,40); normvideo; WRITELN('ERR:',err,' closing record file, check it!'^G); done := FALSE END END; {if no more file output} IF NOT out_f_open AND (output_device = recd_file) THEN BEGIN ASSIGN(out_file,out_fn); {start file output} {$I-} REWRITE(out_file); {$i+} err := IORESULT; IF err <> 0 THEN BEGIN out_fn := '????'; GOTORC(20,40); normvideo; WRITELN('ERR:',err,' opening record file, check it!'^G); disp_e; done := FALSE END ELSE out_f_open := TRUE; END; {if new file output} IF out_f_open AND (output_device = recd_file) AND (out_fn <> old_of) THEN BEGIN {change output file} {$I-} CLOSE(out_file); {$I+} {close old file} err := IORESULT; IF err <> 0 THEN BEGIN out_fn := '????'; GOTORC(20,40); normvideo; WRITELN('ERR:',err,' closing old record file, check it!'^G); done := FALSE END; ASSIGN(out_file,out_fn); {$I-} REWRITE(out_file); {$I+} {open new file} err := IORESULT; IF err <> 0 THEN BEGIN out_fn := '????'; GOTORC(20,40); normvideo; WRITELN('ERR:',err,' opening new record file, check it!'^G); disp_e; done := FALSE END END; {if file output was changed} IF (old_ff <> font_fn) OR NOT font_f_open THEN BEGIN err := POS('.',font_fn); IF err = 0 THEN font_fn := font_fn + '.DAT'; ASSIGN(font_file,font_fn); {$I-} RESET(font_file); {$I+} err := IORESULT; IF err <> 0 THEN BEGIN font_fn := '????'; GOTORC(20,40); normvideo; WRITELN('ERR:',err,' opening Font file, check it!'^G); disp_f; done := FALSE END ELSE BEGIN font_f_open := TRUE; SEEK(font_file,95); READ(font_file,bit_rec); font_width := bit_rec.width; font_height := bit_rec.height; disp_fs; avail_space END {end if bad open} END; {if font filename was changed} IF input_device = text_file THEN BEGIN ASSIGN(in_file,in_fn); {$I-} RESET(in_file); {$I+} err := IORESULT; IF err <> 0 THEN BEGIN in_fn := '????'; GOTORC(20,40); normvideo; WRITELN('ERR:',err,' opening Input file, check it!'^G); done := FALSE END {if bad open} END {if input from file} END END; {procedure ask_x} PROCEDURE ask_f; {f/font file} VAR strng_ans : STRING[14]; {used for filename input} BEGIN WRITELN('The font file contains the definitions for all characters. It is created'); WRITELN('with ''MAKEFONT'' from a ASCII file. (A .DAT extension will be assumed.)'); WRITE('Enter FileName of Font File -> '); normvideo; READ(strng_ans); IF strng_ans <> '' THEN font_fn := strng_ans; disp_f END; {procedure ask_f} PROCEDURE ask_t; {f/sign format} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('One can change to type of sign to format the output horizontally'); WRITELN('across page (sign) or vertically down page (banner). Do you want'); WRITE('a Sign or Banner? (S/B) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'B','b' : sign_type := banner; 'S','s' : sign_type := sign END; {case} disp_t; avail_space END; {procedure ask_t} PROCEDURE ask_b; {f/block type} VAR char_ans : CHAR; {used for single char inut} siz_ans : STRING[3]; {used for number input} num,err : INTEGER; BEGIN WRITELN('The graphic characters may be made of the letter of the character'); WRITELN('itself, two different type of blocks, or Graphic bits. Do you want to print'); WRITE('Single-strike Blocks, Overstrike blocks, Letters, or Bits? (S/O/L/B) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'S','s' : BEGIN block_type := block; GOTORC(22,1); CLREOL; lowvideo; WRITE('Enter Hex code of character to use ->'); normvideo; READLN(siz_ans); IF siz_ans <> '' THEN BEGIN VAL('$'+siz_ans,num,err); block_char := CHR(num) END END; 'L','l' : block_type := letter; 'O','o' : block_type := overstrike; 'B','b' : BEGIN block_type := bit; given_width := Max_Length; avail_space END; END; {case} disp_b END; {procedure_ask_b} PROCEDURE ask_w; {f/width multiplier} VAR err : INTEGER; {err code from strng-to-num convert} siz_ans : STRING[3]; {used for number input} BEGIN WRITELN('One can make the letters of the sign or banner bigger in width'); WRITELN('by entering a multiplier. 2 doubles size, 3 triples, etc.'); WRITE('Enter multiplier for width -> '); normvideo; READLN(siz_ans); IF siz_ans <> '' THEN VAL(siz_ans,mult_w,err); disp_w END; {procedure ask_w} PROCEDURE ask_h; {f/height multiplier} VAR err : INTEGER; {err code from strng-to-num convert} siz_ans : STRING[3]; {used for number input} BEGIN WRITELN('One can make the letters of the sign or banner bigger in height'); WRITELN('by entering a multiplier. 2 doubles size, 3 triples, etc.'); WRITE('Enter multiplier for height -> '); normvideo; READLN(siz_ans); IF siz_ans <> '' THEN VAL(siz_ans,mult_h,err); disp_h END; {procedure ask_h} PROCEDURE ask_g; {f/given device size} VAR err : INTEGER; {err code from strng-to-num convert} siz_ans : STRING[3]; {used for number input} BEGIN WRITELN('If this option is non-zero it will override any of the other'); WRITELN('output size commands. One can enter a defined output device'); WRITE('size (max=',Max_Length,') which will be used for checks and centering -> '); normvideo; READLN(siz_ans); IF siz_ans <> '' THEN VAL(siz_ans,given_width,err); disp_g END; {procedure ask_g} PROCEDURE ask_m; {f/given left margin} VAR err : INTEGER; {err code from strng-to-num convert} siz_ans : STRING[3]; {used for number input} BEGIN WRITELN('One can enter a given left margin to position banners and signs'); WRITELN('on the paper. If the given left margin is zero, automatic centering'); WRITE('can also be done. Enter number for left margin -> '); normvideo; READLN(siz_ans); IF siz_ans <> '' THEN BEGIN VAL(siz_ans,given_offset,err); centering := FALSE END; disp_m END; {procedure ask_m} PROCEDURE ask_a; {f/auto-centering} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('This option is active only if the given left margin is zero.'); WRITELN('Output can be centered within the maximum output width.'); WRITE('Should output be automatically centered? (Y/N) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'N','n' : centering := FALSE; 'Y','y' : centering := TRUE END; {case} disp_a END; {procedure ask_a} PROCEDURE ask_v; {f/inverse video} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('This option reverses spaces to characters and vice-versa, effectively'); WRITELN('changing the output to reverse video. The Background is X''s or blocks.'); WRITE('Do you want Reverse Video output? (Y/N) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'N','n' : inv_video := FALSE; 'Y','y' : inv_video := TRUE END; {case} disp_v END; {procedure ask_v} PROCEDURE ask_y; {f/given device size} VAR err : INTEGER; {err code from strng-to-num convert} char_ans : CHAR; {used for single char input} BEGIN WRITELN('The spacing between the characters output may be varied'); WRITE('from 0 to 9. (1 is normal.) Please enter spacing desired -> '); normvideo; READ(kbd,char_ans); IF char_ans <> '' THEN VAL(char_ans,inter_spc,err); disp_y END; {procedure ask_g,y} PROCEDURE ask_i; {f/input device} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('Input can come from the keyboard in which is is entered one line'); WRITELN('at a time or in a bunch from a external file. Do you want to read'); WRITE('input from the Keyboard or File? (K/F) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'F','f' : input_device := text_file; 'K','k' : input_device := keyboard END; {case} disp_i END; {procedure ask_i} PROCEDURE ask_r; {f/text input file} VAR strng_ans : STRING[14]; {used for filename input} BEGIN WRITELN('This entry is only active if input is read from a file.'); WRITELN('Enter filename of the text file to read that contains the'); WRITE('line(s) to be output -> '); normvideo; READLN(strng_ans); IF strng_ans <> '' THEN in_fn := strng_ans; disp_r END; {procedure ask_r} PROCEDURE ask_n; {f/number of copies} VAR err : INTEGER; char_ans : CHAR; {used for single char inut} BEGIN WRITELN('This entry is only active if input is from a file.'); WRITELN('Multiple copies are separated by formfeeds.'); WRITE('How many copies do you want? -> '); normvideo; READ(kbd,char_ans); IF char_ans <> '' THEN VAL(char_ans,num_copies,err); disp_n END; {procedure ask_n} PROCEDURE ask_o; {f/output device} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('Output may be directed to the console screen, a file or the'); WRITELN('printer. (File output may be up to ',Max_Length,' wide.) Do you'); WRITE('want to output to a File, Screen or Printer? (S/F/P) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'P','p' : output_device := printer; 'S','s' : output_device := screen; 'F','f' : output_device := recd_file END; {case} disp_o END; {procedure ask_o} PROCEDURE ask_s; {f/device size} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('Enter (N) if the output device is either an 8" wide printer or'); WRITELN('80 char CRT; or (W) if it is a 14" printer or 132 char screen.'); WRITE('Is output device size Normal or Wide? (N/W) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'W','w' : device_size := wide; 'N','n' : device_size := normal END; {case} disp_s END; {procedure ask_s} PROCEDURE ask_e; {f/record file} VAR strng_ans : STRING[14]; {used for filename input} BEGIN WRITELN('This entry is only active if output is to be recorded in'); WRITE('a file. Enter filename to record output into -> '); normvideo; READLN(strng_ans); IF strng_ans <> '' THEN out_fn := strng_ans; disp_e END; {procedure ask_e} PROCEDURE ask_p; {f/pitch} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('This entry is active only if outputting to the printer. It controls'); WRITELN('character spacing or pitch: Enter (P)ica for 10 cpi, (E)lite for'); WRITE('12 cpi, (S)queezed for 16.5 cpi, (T)iny for 20 cpi? (P/E/S/T?) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'P','p' : prt_cpi := pica; 'E','e' : prt_cpi := elite; 'S','s' : prt_cpi := squeezed; 'T','t' : prt_cpi := tiny END; {case} disp_p END; {procedure ask_p} PROCEDURE ask_l; {f/line per inch} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('This entry is active only if outputting to the printer.'); WRITELN('This controls line spacing: Enter (S) for 6 lpi,'); WRITE('(E)ight for 8 lpi, (T)en, or tWelve lpi? (S/E/T/W) -> '); normvideo; READ(kbd,char_ans); CASE char_ans OF 'S','s' : prt_lpi := six; 'E','e' : prt_lpi := eight; 'T','t' : prt_lpi := ten; 'W','w' : prt_lpi := twelve END; {case} disp_l; END; {procedure ask_l} PROCEDURE ask_c; {f/color} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('This entry is active only if outputting to the printer.'); WRITELN('Printer can print in (R)ed, (G)reen, b(L)ue or (B)lack.'); WRITE('Enter color desired? (R/G/L/B) ->'); normvideo; READ(kbd,char_ans); CASE char_ans OF 'B','B' : prt_color := black; 'R','r' : prt_color := red; 'G','g' : prt_color := green; 'L','l' : prt_color := blue END; {case} disp_c END; {procedure ask_c} PROCEDURE ask_d; {f/color} VAR char_ans : CHAR; {used for single char inut} BEGIN WRITELN('This entry is active only if outputting to the printer. Answer yes if'); WRITELN('the printer is dumb and can''t respond to the built-in formating codes'); WRITE('or the codes are not matched to it (Y/N) ->'); normvideo; READ(kbd,char_ans); CASE char_ans OF 'Y','y' : dumb_prt := TRUE; 'N','n' : dumb_prt := FALSE END; {case} disp_d END; {procedure ask_d} PROCEDURE ask_q; {f/abort exit} VAR ans : CHAR; BEGIN WRITE('Do you want to abort ''SIGNS'' and quit? (Y/N) -> '^G); normvideo; READ(kbd,ans); IF ans IN ['y','Y'] THEN BEGIN GOTORC(24,1); WRITELN('aborting SIGNS ...'); HALT END END; {procedure ask_q}