Annotation of 43BSDReno/pgrm/pascal/tstpx/src/pcextn.p, revision 1.1.1.1

1.1       root        1: program t(output, foo);
                      2: 
                      3: #include "unixio.h"
                      4: 
                      5: var
                      6: foo :text;
                      7: at :fileptr;
                      8: 
                      9: begin
                     10: rewrite(foo);
                     11: writeln(foo, 'abc');
                     12: reset(foo);
                     13: while not eof(foo) do begin
                     14:        write(foo^);
                     15:        get(foo)
                     16:        end;
                     17: writeln;
                     18: APPEND(foo);
                     19: writeln(foo, 'def');
                     20: reset(foo);
                     21: while not eof(foo) do begin
                     22:        write(foo^);
                     23:        get(foo)
                     24:        end;
                     25: writeln;
                     26: reset(foo);
                     27: while not eoln(foo) do begin
                     28:        write(foo^);
                     29:        get(foo)
                     30:        end;
                     31: writeln;
                     32: get(foo);
                     33: writeln('at TELL foo at ->', foo^, '<-');
                     34: at := TELL(foo);
                     35: get(foo);
                     36: writeln('after get foo at ->', foo^, '<-');
                     37: SEEK(foo, at);
                     38: writeln('after seek foo at ->', foo^, '<-');
                     39: reset(foo);
                     40: writeln('after reset foo at ->', foo^, '<-');
                     41: SEEK(foo,at);
                     42: writeln('after seek foo at ->', foo^, '<-');
                     43: end.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.