$eject /******************************************************** * module name: text10.sim * * public procedure: breakf * ********************************************************/ fnote2: do; declare cr literally '0dh', lf literally '10'; declare tival byte external; /*********************************************************** * global variable data declarations for footnote * ***********************************************************/ declare fbuf(128) byte public, /* line buffer for footnote */ footbuf(768) byte public, /* buffer storage for footnote text */ footptr address public initial (0), /* pointer next to fill */ fprint address public initial (0), /* pointer next to print */ foutp byte public initial (0), /* last char position in fbuf */ foutw byte public initial (0), /* width of text currently in fbuf */ foutwds byte public initial (0), /* number of words in fbuf */ flength byte public initial (0), /* footnote input length */ footlen byte public initial (1); /* footnote text length in buffer */ declare newline literally '2h'; declare firstptr byte public initial (0), /* ptrlist pointer */ lastptr byte public initial (0), ptrlist(20) address public initial (0), /* list of footbuf ptr */ topfn(10) byte public initial ('---------',newline); /* top footnote */ $eject /********************************************************* * breakf - copies fbuf into footbuf. footptr only * * modified here, and set to zero in footflush * * procedure. * *********************************************************/ breakf: procedure public; declare i byte; if foutp > 0 then do; do i = 0 to (foutp - 2); /* line length=foutp-2, */ /* cr & lf is not counted */ footbuf(footptr) = fbuf(i); footptr = footptr + 1; end; footbuf(footptr) = newline; /* end of line */ footptr = footptr + 1; /* next to fill */ lastptr = lastptr + 1; ptrlist(lastptr) = footptr; end; foutp, foutw, foutwds = 0; end breakf; end fnote2; eof