@x \vfill} \pageno=\contentspagenumber \advance\pageno by 1 @y \centerline{(Turbo Pascal Version 1.0.0, February 1987)} \vfill \centerline{\hsize 5in\baselineskip9pt \vbox{\ninerm\noindent The changes required to create this Turbo Pascal version of \.{WEBMERGE} are the portions of the sections marked with asterisks (*) below.}}} \pageno=1 @z @x @d banner=='This is WEBMERGE, Version 1.0' @y For the Turbo Pascal versions of \.{WEBMERGE}, we add a second decimal point and number to the main version number, so we can differentiate between changes to the standard \.{WEBMERGE}\ and changes local to the Turbo Pascal version. @d banner=='This is WEBMERGE, Turbo Pascal Version 1.0.0' @z @x @d stat==@{ {change this to `$\\{stat}\equiv\null$' when gathering usage statistics} @d tats==@t@>@} {change this to `$\\{tats}\equiv\null$' when gathering usage statistics} @y @d stat== {change this to `$\\{stat}\equiv\null$' when gathering usage statistics} @d tats== {change this to `$\\{tats}\equiv\null$' when gathering usage statistics} @z @x @{@&$C-,A+,D-@} {no range check, catch arithmetic overflow, no debug overhead} @!debug @{@&$C+,D+@}@+ gubed {but turn everything on when debugging} @y @{@&$k-@} {no range check, catch arithmetic overflow, no debug overhead} @z @x @d othercases == others: {default for cases not listed explicitly} @y @d othercases == else {default for cases not listed explicitly} @z @x @!buf_size=1000; {maximum length of input line} @y @!buf_size=255; {maximum length of input line} @z @x @d last_text_char=127 {ordinal number of the largest element of |text_char|} @= @!text_file=packed file of text_char; @y @d last_text_char=127 {ordinal number of the largest element of |text_char|} @d text_file==text @z @x rewrite(term_out,'TTY:'); {send |term_out| output to the terminal} reset(term_in,'TTY:','/I'); {open |term_in| as the terminal, don't do a |get|} @y assign(term_out,'con:'); rewrite(term_out); {send |term_out| output to the terminal} assign(term_in,'con:'); reset(term_in); {get |term_in| input from the terminal} @z @x @d update_terminal == break(term_out) {empty the terminal output buffer} @y @d update_terminal == @z @x begin reset(web_file); rewrite(out_web_file); rewrite(out_change_file); @y begin assign(web_file,paramstr(1) ); reset(web_file); assign(out_web_file,paramstr(2)); rewrite(out_web_file); assign(out_change_file,paramstr(3)); rewrite(out_change_file); @z @x @p function input_ln(var f:text_file):boolean; {inputs a line or returns |false|} var final_limit:0..buf_size; {|limit| without trailing blanks} begin limit:=0; final_limit:=0; if eof(f) then input_ln:=false else begin while not eoln(f) do begin buffer[limit]:=xord[f^]; get(f); incr(limit); if buffer[limit-1]<>" " then final_limit:=limit; if limit=buf_size then begin while not eoln(f) do get(f); decr(limit); {keep |buffer[buf_size]| empty} print_nl('! Input line too long'); loc:=0; error; @.Input line too long@> end; end; read_ln(f); limit:=final_limit; input_ln:=true; end; end; @y @p function input_ln(var f:text_file):boolean; {inputs a line or returns |false|} label done; var @!aux_buf:string[buf_size]; {intermediate input buffer} k:0..buf_size; {index into |buffer|} begin limit:=0; if eof(f) then input_ln:=false else begin read(f,aux_buf); read_ln(f); limit:=length(aux_buf); if limit>=buf_size then begin print_nl('! Input line too long'); loc:=0; error; @.Input line too long@> limit:=buf_size-1; end; for k:=1 to limit do buffer[k-1]:=xord[aux_buf[k]]; while limit>1 do if buffer[limit-1]=" " then decr(limit) @+else goto done; done: input_ln:=true; end; end; @z @x @!temp : 0..buf_size; begin if limit > 0 then begin for temp := 0 to limit - 1 do begin ch := xchr[buffer[temp]]; f^ := ch; put(f); end; end; write_ln(f); @y @!temp : 0..buf_size; @!aux_buf:string[buf_size]; {intermediate input buffer} begin if limit > 0 then begin for temp := 0 to limit - 1 do begin aux_buf[temp+1] := xchr[buffer[temp]]; end; end; aux_buf[0] := chr(limit); write_ln(f,aux_buf); @z @x and jumps out of the program. This is the only non-local |goto| statement in \.{WEBMERGE}. It is used when no recovery from a particular error has been provided. @y and jumps out of the program. It calls a DOS routine to exit. It is used when no recovery from a particular error has been provided. @z @x begin goto end_of_WEBMERGE; end; @y begin stat @;@+tats@;@/ close(web_file); close(out_web_file); close(out_change_file); if number_of_actual_change_files > 0 then for active_change_file:=1 to number_of_actual_change_files do close(change_file); @; halt(history); end; @z @x more_names := (not eof(term_in)) and (active_change_file < max_change_files) ; if more_names then begin write_ln(term_out,'next_change_file:'); read_ln(term_in,filename); if filename[1] <> ' ' then begin incr(active_change_file); reset(change_file,filename); @y more_names := (active_change_file < max_change_files) ; if more_names then begin if (active_change_file + 3) < paramcount then begin incr(active_change_file); assign(change_file,paramstr(active_change_file + 3) ); reset(change_file); @z @x @t\4\4@>{here files should be closed if the operating system requires it} @; @y close(web_file); close(out_web_file); close(out_change_file); if number_of_actual_change_files > 0 then for active_change_file:=1 to number_of_actual_change_files do close(change_file); @; halt(history); @z