Annotation of 43BSDReno/pgrm/pascal/tstpx/src/backtracerr.p, revision 1.1

1.1     ! root        1: program frecur( output );
        !             2:     var
        !             3:        time : integer;
        !             4:        direction : integer;
        !             5:     function pad( j : integer ) : integer;
        !             6:        const
        !             7:            indent = 4;
        !             8:        begin
        !             9:            {}
        !            10:            if ( j <= 0 ) then begin
        !            11:                j := 1;
        !            12:            end;
        !            13:            {}
        !            14:            pad := j * indent;
        !            15:        end;
        !            16:     procedure a( procedure xx );
        !            17:        begin
        !            18:            writeln( ' ':pad(time) , 'a: about to       xx()' );
        !            19:            xx;
        !            20:            writeln( ' ':pad(time) , 'a: back from      xx()' );
        !            21:        end;
        !            22:     procedure b( procedure yy );
        !            23:        procedure c;
        !            24:            begin
        !            25:                writeln( ' ':pad(time) , 'c: about to   a(yy)' );
        !            26:                time := time + direction;
        !            27:                a( yy );
        !            28:                writeln( ' ':pad(time) , 'c: back from  a(yy)' );
        !            29:            end;
        !            30:        begin
        !            31:            if ( direction = 1 ) then begin
        !            32:                if ( time > 10 ) then begin
        !            33:                    direction := -direction;
        !            34:                end;
        !            35:                time := time + direction;
        !            36:                writeln( ' ':pad(time) , 'b: about to   b(c)' );
        !            37:                b( c );
        !            38:                writeln( ' ':pad(time) , 'b: back from  b(c)' );
        !            39:            end else begin
        !            40:                writeln( ' ':pad(time) , 'b: about to   yy' );
        !            41:                yy;
        !            42:                writeln( ' ':pad(time) , 'b: back from  yy' );
        !            43:            end;
        !            44:        end;
        !            45:        procedure d;
        !            46:            begin
        !            47:                writeln( 'd:' );
        !            48:            end;
        !            49:     begin
        !            50:        time := 1;
        !            51:        direction := 1;
        !            52:        writeln( 'program: about to     b( d )' );
        !            53:        b( d );
        !            54:        writeln( 'program: back from    b( d )' );
        !            55:     end.

unix.superglobalmegacorp.com

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