home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
turbopas
/
tlist11.lbr
/
PROCLINE.PQS
/
procline.pas
Wrap
Pascal/Delphi Source File
|
1985-11-08
|
3KB
|
84 lines
PROCEDURE Abort_TLIST;
BEGIN
IF Ch = ^C THEN
BEGIN
WRITELN;
WRITELN('TLIST Aborted.');
CLOSE(Text_File);
IF DiskFile THEN CLOSE(List_file);
WRITELN(Page_number, ' pages.');
WRITELN;
HALT;
END;
END;
PROCEDURE Process_Line;
VAR
Contnu : BOOLEAN;
Temp : Line_Type;
BEGIN
Contnu := TRUE;
WHILE Contnu DO
BEGIN
Contnu := FALSE;
Expand_Tabs(Line);
Temp := COPY(Line, 1, Line_Width);
Line := COPY(Line, 1 + LENGTH(Temp), 255);
Contnu := LENGTH(Line) > 0;
Replace_Symbols_In_Line(Temp);
IF Page_number >= Starting_page_number THEN
IF DiskFile THEN
WRITELN(List_file, Temp:(LENGTH(Temp) + Page_Offset))
ELSE
WRITELN(LST, Temp:(LENGTH(Temp) + Page_Offset));
Line_number := Line_number + 1;
IF Line_number = Max_no_lines THEN
BEGIN
IF Page_number >= Starting_page_number THEN
BEGIN
IF DiskFile THEN
BEGIN
FOR I := 1 TO Footer_Margin DO WRITELN(List_file);
WRITELN(List_file, Footer_String:(LENGTH(Footer_String) + Page_Offset));
FOR I := 1 TO Margin_Bottom - Footer_Margin - 1 DO WRITELN(List_file);
END
ELSE
BEGIN
FOR I := 1 TO Footer_Margin DO WRITELN(LST);
WRITELN(LST, Footer_String:(LENGTH(Footer_String) + Page_Offset));
FOR I := 1 TO Margin_Bottom - Footer_Margin - 1 DO WRITELN(LST);
END;
IF Paginate THEN
BEGIN
WRITE(' Page ', Page_number,
' PAUSE; "P" to continue, ^C to abort ... ');
READ(KBD, Ch);
Abort_TLIST;
END;
END;
Line_number := 0;
Page_number := Page_number + 1;
IF Page_number >= Starting_page_number THEN
BEGIN
IF DiskFile THEN
BEGIN
FOR I := 1 TO Margin_Top - Header_Margin - 1 DO WRITELN(List_file);
WRITELN(List_file, Header:(LENGTH(Header) + Page_Offset), ^M,
'Page':(Line_Width + Page_Offset - 4), Page_number:4);
FOR I := 1 TO Header_Margin DO WRITELN(List_file);
END
ELSE
BEGIN
FOR I := 1 TO Margin_Top - Header_Margin - 1 DO WRITELN(LST);
WRITELN(LST, Header:(LENGTH(Header) + Page_Offset), ^M,
'Page':(Line_Width + Page_Offset - 4), Page_number:4);
FOR I := 1 TO Header_Margin DO WRITELN(LST);
END;
END;
END;
END;
END;