/* type.tc - tct - 5/29,30/9 6/1/9 3/22/10 12/20/18 */ /* displays a file */ sak [pl "strike any key ...";getchar] main char f(0) [ pl "";ps "type.tc - 12/20/18";pl "";pl "" char where(15000),lfs(1);int cnt,ix,lines lfs(0)=10 /* ascii code for linefeed */ if ((cnt=readfile(f,where,15000))>0) [ /* read file into memory */ while ((ix=index(where,cnt,lfs,1))>0) [ /* loop while linefeeds are detected */ pft where,where+ix-1 /* print a line */ where=where+ix /* next search will start at the beginning of the next line */ cnt=cnt-ix /* decrement the count of characters to search */ lines=lines+1 if (lines>19) [sak;pl "";pl "";lines=0] /* force user to hit Enter every 20 lines */ ] ] ]