home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / AWF.ZIP / MS.P2 < prev    next >
Text File  |  1990-12-12  |  792b  |  41 lines

  1. /^\.\^b/ {            # initialization
  2.     nhnos[1] = 0
  3.     next
  4. }
  5. /^[^.]/ {            # text line -- reached only for input traps
  6.     if (afternext == ",tP")
  7.         print dobreak, "toindent"
  8.     afternext = ""
  9.     next
  10. }
  11. /^\.nH/ {            # fooling around for numbered headings
  12.     no = 1
  13.     if (NF > 1)
  14.         no = $2
  15.     if (no == 0) {
  16.         nhnos[1] = 0
  17.         no = 1
  18.     }
  19.     nhnos[no]++
  20.     for (n in nhnos)
  21.         if (n > no)
  22.             nhnos[n] = 0
  23.     s = ""
  24.     for (n = 1; n <= no; n++)
  25.         s = s nhnos[n] "."
  26.     strings["Nh"] = s        # result in string for macro to grab
  27.     next
  28. }
  29. /^\.ds/ {            # to catch special strings
  30.     if ($3 !~ /^"/)
  31.         v = $3
  32.     else
  33.         v = substr($0, index($0, "\"")+1)
  34.     if ($2 ~ /^[LCR][HF]$/)
  35.         print nobreak, $2, v
  36.     # fallthrough to normal .ds processing in macro-independent stuff
  37. }
  38. /^\.\^e/ {            # finalization
  39.     next
  40. }
  41.