* PLOT0.CMD  Plots border for PLOT.CMD
*
ERASE
STORE 0 TO XPOS
STORE 0 TO YPOS
STORE 0 TO CNTR
* Set graphics chrs on
? CHR(27)+CHR(103)
*
* vert axis
DO WHILE YPOS<PLOT:BT
  IF INT(CNTR*PLOT:BT/(YMARKS+.01)) = YPOS
    STORE 12 TO CHRN
    STORE CNTR+1 TO CNTR
  ELSE
    STORE 11 TO CHRN
  ENDIF
  @ YPOS,PLOT:LF SAY CHR(CHRN)
  STORE YPOS+1 TO YPOS
ENDDO
*
* horz axis
STORE PLOT:LF TO XPOS
STORE 0 TO CNTR
DO WHILE XPOS<=PLOT:RT
  IF INT(CNTR*(PLOT:RT-PLOT:LF-1)/(XMARKS-.01))= XPOS-PLOT:LF-1
    STORE 3 TO CHRN
    STORE CNTR+1 TO CNTR
  ELSE
    STORE 24 TO CHRN
  ENDIF
  IF XPOS=PLOT:LF
    STORE 26 TO CHRN
  ENDIF
  @ PLOT:BT,XPOS SAY CHR(CHRN)
  STORE XPOS+1 TO XPOS
ENDDO
*
* Put numeric values on axis
STORE 1 TO CNTR
DO WHILE CNTR<5
  DO CASE
    CASE CNTR=1
      STORE MAXY TO PRVAR
      STORE 0 TO YPOS
      STORE 0 TO XPOS
    CASE CNTR=2
      STORE MINY TO PRVAR
      STORE PLOT:BT-1 TO YPOS
    CASE CNTR=3
      STORE MINX TO PRVAR
      STORE PLOT:BT+1 TO YPOS
      STORE PLOT:LF TO XPOS
    CASE CNTR=4
      STORE MAXX TO PRVAR
      STORE PLOT:RT-5 TO XPOS
  ENDCASE
  DO CASE
    CASE PRVAR>=100 .OR. PRVAR<=-100
      @ YPOS,XPOS SAY PRVAR USING '999999'
    CASE PRVAR>=1 .OR. PRVAR<=-1
      @ YPOS,XPOS SAY PRVAR USING '999.99'
    OTHERWISE
      @ YPOS,XPOS SAY PRVAR USING '9.9999'
  ENDCASE
STORE CNTR+1 TO CNTR
ENDDO
*
* Put left side title on plot
STORE 1 TO CNTR
DO WHILE CNTR <= LEN(TRIM(SIDTI))
  STORE PLOT:BT/2 - LEN(TRIM(SIDTI))/2 + CNTR TO YPOS
  @ YPOS,2 SAY $(SIDTI,CNTR,1)
  STORE CNTR+1 TO CNTR
ENDDO
*
RETURN
