proc settabs:
rem V2.0 Set tab positions on an epson compatible printer
global tb%(16),t%,a$(1),o%
local o$(1),i%,abort
do
  cls
  minit
  mcard "HORIZONTAL TABS","Set every 8th column",%8,"Set every fourth column",%4,"Specify the columns",%s
  mcard "VERTICAL TABS","Set Vertical Tabs",%v,"EXIT",%x
  o%=menu
  if o%=%8
		a$="D"
    t%=8
		ftab:
		dtab:
  elseif o%=%4
		a$="D"
    t%=4
		ftab:
		dtab:
  elseif o%=%s or o%=%v
    if o%=%s
			a$="D"
		else
			a$="B"
		endif
		abort=vtab:
		if abort=0 :dtab:
		else
      giprint "Aborted."
		endif
	endif
until o%=%x
return
endp

proc ftab:
local i%,j%
i%=1
j%=t%
while i%<16
  tb%(i%)=j%
  j%=j%+t%
  i%=i%+1
endwh
tb%(i%)=0
endp

proc dtab:
local col%,lin%,i%,lstring$(255)
cls
print "Tabs set as follows..."
lstring$=chr$(27)+a$
i%=1 :lin%=2 :col%=1
while i%<16 and tb%(i%)<>0
  at col%,lin%
  print gen$(tb%(i%),-4); :lstring$=lstring$+chr$(tb%(i%))
  col%=col%+4
  if col%>40
    col%=1
    lin%=lin%+1
	endif
  i%=i%+1
endwh
lstring$=lstring$+chr$(0)
print
lopen "PAR:A" :lprint lstring$; :lclose
giprint "OK - Tabs set"
endp

proc vtab:
local i%,o$(1)
cls
print "Enter tab positions in sequence (16 max, 0=last)"
i%=1 :t%=99
while i%<16 and t%<>0
  print "Tab",gen$(i%,-2),
  input t%
  tb%(i%)=t%
  if i%>1
    if tb%(i%)<>0 and tb%(i%)<=tb%(i%-1)
			beep 10,50
			print "You must enter them in ascending order"
			print "Enter 1=Try again 2=Redo them all 3=Quit ";
			do
				o$=upper$(get$)
			until loc("123",o$)>0
			print o$
			if o$="2"
        i%=1
			elseif o$="3"
				return 1
			endif
		else
      i%=i%+1
		endif
	else
    i%=i%+1
	endif
endwh
tb%(i%)=0
endp

