BBS: Inland Empire Archive Date: 12-27-92 (12:27) Number: 389 From: DIK COATES Refer#: NONE To: CORIDON HENSHAW Recvd: NO Subj: Re: scroll part 1 of 3 Conf: (2) Quik_Bas
>>>> QUOTING Coridon Henshaw to Dik Coates <<<<
DC> You talkin' text mode, or graphics mode... Text mode, I have a series
DC> of routines I will upload if you want...
CH> I'd like to see that. Both upward and downward, please ;>
Here goes... Will set it up in three chunks...
The first file converts a normal ASCII file to one that can be read
as a binary file.
- - - - - - - - - - - - Cut on Dashed Line - - - - - - - - - - - - -
DECLARE FUNCTION FILEEXIST% (filename$)
DECLARE SUB CommandLine (narg%, arg$())
REDIM arg$(32)
CALL CommandLine(narg%, arg$())
CLS
IF narg% <> 0 THEN
REDIM PRESERVE arg$(narg%)
IF narg% > 2 THEN
LOCATE 12, 25
PRINT "Too many arguments on Command Line"
LOCATE 23, 21
PRINT ">>>>> Press Any Key to Exit to DOS <<<<<";
DO
a$ = INKEY$
LOOP UNTIL LEN(a$)
CLS
END
END IF
IF narg% < 2 THEN
LOCATE 12, 25
PRINT "Insufficient arguments on Command Line"
LOCATE 23, 21
PRINT ">>>>> Press Any Key to Exit to DOS <<<<<";
DO
a$ = INKEY$
LOOP UNTIL LEN(a$)
CLS
END
END IF
IF NOT FILEEXIST%(arg$(1)) THEN
LOCATE 12, 25
PRINT "Text File does not Exist"
LOCATE 23, 21
PRINT ">>>>> Press Any Key to Exit to DOS <<<<<";
DO
a$ = INKEY$
LOOP UNTIL LEN(a$)
CLS
END
ELSE
filenum1% = FREEFILE
OPEN arg$(1) FOR INPUT AS #filenum1%
filenum2% = FREEFILE
OPEN arg$(2) FOR BINARY AS #filenum2%
DO WHILE NOT EOF(filenum1%)
LINE INPUT #filenum1%, strdummy$
count% = count% + 1
LOOP
CLOSE #filenum1%
PUT #filenum2%, , count%
filenum1% = FREEFILE
OPEN arg$(1) FOR INPUT AS #filenum1%
FOR c% = 1 TO count%
LINE INPUT #filenum1%, strdummy$
lendummy% = LEN(strdummy$)
PUT #filenum2%, , lendummy%
PUT #filenum2%, , strdummy$
NEXT c%
END IF
ELSE
CLS
LOCATE 12, 25
PRINT "USAGE: FASC2BIN textfile binfile"
LOCATE 23, 21
PRINT ">>>>> Press Any Key to Exit to DOS <<<<<";
DO
a$ = INKEY$
LOOP UNTIL LEN(a$)
END IF
CLS
END
- - - - - - - - - - - - Cut on Dashed Line - - - - - - - - - - - - -
... That tagline is TRUE -> <- That tagline is FALSE
___ Blue Wave/QWK v2.10
--- Maximus 2.00
* Origin: Durham Systems (ONLINE!) (1:229/110)

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