File:  [CSRG BSD Unix] / 43BSD / contrib / icon / src / lib / snapshot.icn
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43
BSD 4.3

#	SNAPSHOT(2)
#
#	Snapshot of string scanning
#
#	Ralph E. Griswold
#
#	Last modified 5/12/83
#

procedure snapshot()
   local bar, p1, p2, p3, i
   if pos(0) then {
      p2 := *image(&subject) - 2
      p1 := p2 + 1
      p3 := 0
      }
   else {
      p1 := 0
      every i := 1 to &pos do
         p1 +:= *image(&subject[i]) - 2
      p3 := *image(&subject[&pos]) - 3
      p2 := p1
      every i := &pos + 1 to *&subject do
         p2 +:= *image(&subject[i]) - 2
      }
   write(bar := repl("-",17 + p2))
   write("|",right("|",16 + p2))
   write("| &subject = ",image(&subject)," |")
   write("|            ",right("|",p1 - p3 + 1),
      right("|",p2 - p1 + p3 + 3))
   write(bar)
   return
end


unix.superglobalmegacorp.com

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