|
25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more... |
Home Projects Up Sitemap Search Blog Forum+Chat About Us Privacy Terms of Use Feedback FAQ Images Services Payments Humor Music |
Microsoft MBASIC saved its files in a compressed tokenized format. Before compiling a program with the MBASIC compiler, it was necessary to save the file in ASCII with the SAVE ,A switch. However, doing that made the lines longer, and the compiler would not compile lines longer than 127 characters.
This program scans the ASCII file and tells you if any lines exceed 127 characters.
10 REM "LINE2LON.BAS" 03-12-83 11 'COPYRIGHT (C)1983 BY STEVEN WHITNEY. 12 'Published under GNU GPL (General Public License) Version 3, with ABSOLUTELY NO WARRANTY. 20 PRINT "MBASIC PROGRAMS STORED IN ASCII FORMAT MAY CONTAIN LINES TOO LONG" 30 PRINT "TO LOAD INTO MBASIC! THIS PROGRAM WILL SCAN THE PROGRAM OF YOUR" 40 PRINT "CHOOSING AND WARN YOU OF ANY LINES THAT ARE LONGER THAN 127 CHARACTERS." 50 PRINT "127 IS BECAUSE THE COMPILER WON'T TAKE LINES LONGER THAN THAT," 55 PRINT "ALTHOUGH THE INTERPRETER WILL." 60 PRINT : PRINT 70 FILES "*.BAS" 80 PRINT : PRINT 90 INPUT "WHAT BASIC PROGRAM WOULD YOU LIKE TO SCAN?"; A$ 100 OPEN "I", 1, A$ 110 WHILE NOT EOF(1) 120 LINE INPUT #1, T$ 130 IF LEN(T$) > 127 THEN PRINT CHR$(7); T$ 140 WEND 150 CLOSE 160 END
|
|
|
|
|
Copyright ©2010 Steven Whitney. Last modified Thu 10/21/2010 02:08:03 -0700. |
||