BBS: Inland Empire Archive Date: 12-27-92 (12:27) Number: 390 From: DIK COATES Refer#: NONE To: CORIDON HENSHAW Recvd: NO Subj: Re: scroll part 2 of 3 Conf: (2) Quik_Bas
This is the second bunch.... of 3
It has routines used with the first listing...
- - - - - - - - - - - - - - Cut on Dashed Line - - - - - - - - - - -
'************************************************************ SUB CommandLine
'
' Procedure returns command line arguments. Arguments must be separated by
' spaces, tabs, or "/". A maximum of 32 arguments can be returned in a
' array. The array must be declared as a dynamic array from the calling
' program.
'
' ARG: NUL
' RET: narg% - number of arguments on the command line
' arg$() - string array listing arguments
' COMP: MS BASIC 7.1
' REV: 91-10-28 header format
'
'****************************************************************************
'
SUB CommandLine (narg%, arg$())
cl$ = COMMAND$
l% = LEN(cl$)
FOR c% = 1 TO l%
temp$ = MID$(cl$, c%, 1)
IF temp$ = " " OR temp$ = CHR$(9) OR temp$ = "/" THEN
flag% = 0
ELSE
IF NOT flag% THEN
narg% = narg% + 1
flag% = -1
END IF
arg$(narg%) = arg$(narg%) + UCASE$(temp$)
END IF
NEXT c%
END SUB' CommandLine
'******************************************************** FUNCTION FILEEXIST%
'
' Procedure determines if a file exists. If file exists, then a -1 is
' returned, otherwise a 0 is returned. Procedure avoids using ON ERROR call.
'
' CALL: FILEEXIST% (filename$)
'
' ARG: filename$ - full path and filename of file to be tested
'
' COMP: MS Basic 7.1
'
' REV: 91-10-30
'
'****************************************************************************
'
FUNCTION FILEEXIST% (filename$)
FILEEXIST% = -1
IF LEN(DIR$(filename$)) = 0 THEN
FILEEXIST% = 0
END IF
END FUNCTION
'******************************************************** SUBPROGRAM ScrollDn
'
' Procedure scrolls the display window specified by the top and bottom rows
' and the left and right columns down by a number of declared rows. The
' space left behind is changed to the colour attribute of the background.
'
' CALL: ScrollDn (trow%, icol%, brow%, fcol%, numrow%, bga%)
'
' ARG: trow% = top row of window to be scrolled
' icol% = initial column of window
' brow% = bottom row of window
' fcol% = final column of window
' numrow% = number of rows to be scrolled down
' bga% = background colour attribute
'
' USES: Interrupt()
'
' COMP: MS Basic 7.1
'
' LIB: DOS.LIB/QLB
'
' REV: 91-11-13
'
'****************************************************************************
'
SUB ScrollDn (trow%, icol%, brow%, fcol%, numrow%, bga%)
DIM InReg AS RegType, OutReg AS RegType
tr% = trow% - 1
ic% = icol% - 1
br% = brow% - 1
fc% = fcol% - 1
temp% = bga%
IF temp% < 0 OR temp% > 15 THEN
temp% = 0
END IF
temp% = temp% * 16
InReg.ax = 1792 + numrow%
InReg.bx = temp% * 256
InReg.cx = tr% * 256 + ic%
InReg.dx = br% * 256 + fc%
CALL Interrupt(&H10, InReg, OutReg)
END SUB 'ScrollDn
'******************************************************** SUBPROGRAM ScrollUp
'
' Procedure scrolls the display window specified by the top and bottom rows
' and the left and right columns up by a number of declared rows. The
' space left behind is changed to the colour attribute of the background.
'
' CALL: ScrollUp (trow%, icol%, brow%, fcol%, numrow%, bga%)
'
' ARG: trow% = top row of window to be scrolled
' icol% = initial column of window
' brow% = bottom row of window
' fcol% = final column of window
' numrow% = number of rows to be scrolled up
' bga% = background colour attribute
'
' USES: Interrupt()
'
' COMP: MS Basic 7.1
'
' LIB: DOS.LIB/QLB
'
' REV: 91-11-13
'
'****************************************************************************

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET