Annotation of 43BSD/contrib/icon/src/lib/snapshot.icn, revision 1.1

1.1     ! root        1: #      SNAPSHOT(2)
        !             2: #
        !             3: #      Snapshot of string scanning
        !             4: #
        !             5: #      Ralph E. Griswold
        !             6: #
        !             7: #      Last modified 5/12/83
        !             8: #
        !             9: 
        !            10: procedure snapshot()
        !            11:    local bar, p1, p2, p3, i
        !            12:    if pos(0) then {
        !            13:       p2 := *image(&subject) - 2
        !            14:       p1 := p2 + 1
        !            15:       p3 := 0
        !            16:       }
        !            17:    else {
        !            18:       p1 := 0
        !            19:       every i := 1 to &pos do
        !            20:          p1 +:= *image(&subject[i]) - 2
        !            21:       p3 := *image(&subject[&pos]) - 3
        !            22:       p2 := p1
        !            23:       every i := &pos + 1 to *&subject do
        !            24:          p2 +:= *image(&subject[i]) - 2
        !            25:       }
        !            26:    write(bar := repl("-",17 + p2))
        !            27:    write("|",right("|",16 + p2))
        !            28:    write("| &subject = ",image(&subject)," |")
        !            29:    write("|            ",right("|",p1 - p3 + 1),
        !            30:       right("|",p2 - p1 + p3 + 3))
        !            31:    write(bar)
        !            32:    return
        !            33: end
        !            34: 

unix.superglobalmegacorp.com

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