'===========================================================================
' Subject: Soft-scrolling File Viewer         Date: 06-11-03 (  :  )       
'  Author: Dieter Folger                      Code: PB                     
'  Origin: ba2049@bnv-bamberg.de            Packet: TEXT.ABC
'===========================================================================
'--------------------------------
' SCROLL.BAS for PowerBasic
' Soft scrolling file viewer
' Syntax: Scroll [Filename.ext]
' While the text scrolls it can
' be stopped with a keypress
' ESC key ends the program
'--------------------------------
F$ = UCASE$(COMMAND$)
IF DIR$(F$)="" THEN
   IF F$="" THEN
      PRINT "Usage: SCROLL [Filename to view]"
   ELSE
      PRINT F$ "not found";
   END IF
   END
END IF
CLS
OPEN F$ FOR INPUT AS #1
WHILE NOT EOF(1)
   LINE INPUT #1, L$
   IF CSRLIN = 25 THEN
      FOR t = 0 TO 7
          VertPan t*2
          WaitRetrace
      NEXT
      VertPan 0
   END IF
   PRINT L$
   K$=INKEY$
   IF LEN(K$) THEN
      IF K$=CHR$(27) THEN END
      DO: K$=INKEY$: LOOP UNTIL LEN(K$)
   END IF
WEND
CLOSE
END
'-------------------
SUB VertPan (BYVAL i AS BYTE)
'-------------------
 ! mov dx,&h3d4
 ! mov al,8
 ! mov ah,i
 ! out dx,ax
END SUB
'-----------------
SUB WaitRetrace
'-----------------
 ! mov dx,&h3da
lbl1:
 ! in al,dx
 ! test al,8
 ! jnz lbl1
lbl2:
 ! in al,dx
 ! test al,8
 ! jz lbl2
END SUB

