home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / utilsr / settab / SETTABS.OPL next >
Text File  |  1992-10-12  |  2KB  |  104 lines

  1. proc settabs:
  2. rem V2.0 Set tab positions on an epson compatible printer
  3. global tb%(16),t%,a$(1),o%
  4. local o$(1),i%,abort
  5. do
  6.   cls
  7.   minit
  8.   mcard "HORIZONTAL TABS","Set every 8th column",%8,"Set every fourth column",%4,"Specify the columns",%s
  9.   mcard "VERTICAL TABS","Set Vertical Tabs",%v,"EXIT",%x
  10.   o%=menu
  11.   if o%=%8
  12.         a$="D"
  13.     t%=8
  14.         ftab:
  15.         dtab:
  16.   elseif o%=%4
  17.         a$="D"
  18.     t%=4
  19.         ftab:
  20.         dtab:
  21.   elseif o%=%s or o%=%v
  22.     if o%=%s
  23.             a$="D"
  24.         else
  25.             a$="B"
  26.         endif
  27.         abort=vtab:
  28.         if abort=0 :dtab:
  29.         else
  30.       giprint "Aborted."
  31.         endif
  32.     endif
  33. until o%=%x
  34. return
  35. endp
  36.  
  37. proc ftab:
  38. local i%,j%
  39. i%=1
  40. j%=t%
  41. while i%<16
  42.   tb%(i%)=j%
  43.   j%=j%+t%
  44.   i%=i%+1
  45. endwh
  46. tb%(i%)=0
  47. endp
  48.  
  49. proc dtab:
  50. local col%,lin%,i%,lstring$(255)
  51. cls
  52. print "Tabs set as follows..."
  53. lstring$=chr$(27)+a$
  54. i%=1 :lin%=2 :col%=1
  55. while i%<16 and tb%(i%)<>0
  56.   at col%,lin%
  57.   print gen$(tb%(i%),-4); :lstring$=lstring$+chr$(tb%(i%))
  58.   col%=col%+4
  59.   if col%>40
  60.     col%=1
  61.     lin%=lin%+1
  62.     endif
  63.   i%=i%+1
  64. endwh
  65. lstring$=lstring$+chr$(0)
  66. print
  67. lopen "PAR:A" :lprint lstring$; :lclose
  68. giprint "OK - Tabs set"
  69. endp
  70.  
  71. proc vtab:
  72. local i%,o$(1)
  73. cls
  74. print "Enter tab positions in sequence (16 max, 0=last)"
  75. i%=1 :t%=99
  76. while i%<16 and t%<>0
  77.   print "Tab",gen$(i%,-2),
  78.   input t%
  79.   tb%(i%)=t%
  80.   if i%>1
  81.     if tb%(i%)<>0 and tb%(i%)<=tb%(i%-1)
  82.             beep 10,50
  83.             print "You must enter them in ascending order"
  84.             print "Enter 1=Try again 2=Redo them all 3=Quit ";
  85.             do
  86.                 o$=upper$(get$)
  87.             until loc("123",o$)>0
  88.             print o$
  89.             if o$="2"
  90.         i%=1
  91.             elseif o$="3"
  92.                 return 1
  93.             endif
  94.         else
  95.       i%=i%+1
  96.         endif
  97.     else
  98.     i%=i%+1
  99.     endif
  100. endwh
  101. tb%(i%)=0
  102. endp
  103.  
  104.