/* file.tc - tct - 1/29/10,3/10/2011 */ /* displays contents of user-specified file */ file char f(0) [ pl "";ps "file.tc - 3/10/11";pl "";pl "" char where(21000),lfs(1);int cnt,ix,lines /* ascii code for linefeed */ lfs(0)=10 /* read file into memory */ if ((cnt=readfile(f,where,where+21000,1))>0) [ /* loop while linefeeds are detected */ while ((ix=index(where,cnt,lfs,1))) [ /* print a line */ pft where,where+ix-1 /* next search will start at beginning of next line */ where=where+ix cnt=cnt-ix /* decrement the count of characters to search */ /* force user to hit Enter every 20 lines */ if (++lines>19) [sak;pl "";pl "";lines=0] ] ] ]