The Last Book of GW-Basic
The Last Book of GW-Basic
by
Joseph Sixpack
Go to the GW-BASIC Table of Contents
What is offered here is a series of GW-BASIC programs that
are minimalist in size and features, but still offer a very
basic functionality. There are a couple of methods offered
to write letters, do minimalist spreadsheets, "databases" or
actually how to handle lists, some financial functions, some
simple K.I.S.S. accounting methods, the usual checkbook, and
other whatnot.
As these UNPROFESSIONAL programs developed at home over the
years, i noticed that they began to fulfill a basic system
workable for home use. And indeed, that is just what
happened. Currently, being an average joseph_sixpack, i can
do almost everything i need to do with a computer with just
the: (trumpets please)
"Four Files of the Apocalypse"
Which amount to three system files from DOS 6.22 plus the
latest version (3.23) of GW-BASIC from DOS 4.01 which listed
below are:
file name size in bytes
1. COMMAND.COM 54,645
2. IO.SYS. 40,774
3. MSDOS.SYS 38,138
4. GW-BASIC.EXE 80,608
=======
Total System Size: 214,165
That's it. That is the whole computer software system.
A grand total of a little over 200k. It will fit on 1/6 to
1/7th of a floppy.
Now, i ask you, who needs 50,000,000 bytes of code to write,
"Dear Mom, how are you?, I am fine."?
When, for the most part, for the rest of us, just 24 bytes
of GW-BASIC code will do the job fine, plus the letter or
memo or RFQ data to send that letter, memo, or rfq, to the
printer. 24 bytes verses 50,000,000 bytes... ?
Is something wrong here?
ahem... Now the applications for GW-BASIC are another
matter...
You said small...
i have a total of over a million bytes of gw-basic programs
in hundreds of gw-basic programs and other baloney on my
hard drive for the interpreter. Plus, a few other tiny
assembly programs written by others. But the basics are
well under a meg and even less if zipped. it's true that
my system tends to suffer from middle aged spread and get
fatter as it gets older.
And one last final caveat:
Be well informed, and well aware, that these are NOT
professional programs. Little error trapping is done
for most programs so you gotta know what you are entering.
Some programs are error trapped just to show you how to
error trap if you are a complete newbie and don't have any
documentation.
For every program that i managed to stumble through and
finally get running mostly correctly, there must be an
innumerable number of far better gw-basic programs out there
in cyberland that have been better coded by professionals.
For example, the "word processor stuff" was done far better
from a long gone magazine called "Compute" which actually
had a basic loader load in assembly code for a tiny word
processor. "Write, Edit and Print" was a program that used
gw-basic alone to create a nifty word processor. That program
took up a whole book!
Professional Accounting programs were written, And so on and
on... i don't remember seeing a spreadsheet program done by
a professional, but i am sure there are more than a couple
out there in cyberspace somewhere. Same is true for
databases. What we need to do is to gather them all up
legally in one place, with permission from the authors to
put them in the public domain to be used by and for the,
lonely (not looney) affectionados of minimalist gw-basic.
While i think of it, Forth & Turbo Pascal are other good
candidates for use by minimalists.
In the Beginning, there was the End
The following GW-Basic code is the first part of this e-book
called, "The Last Book of GW-Basic" where we create a set of
GW-Basic interlinking applications called humorously,
"The Four Files of the Apocalypse"
or
"GW-BASIC OFFICE v1.00
or
GW-BASIC SUITE 1983
The Menuing System
The first program up on the screen loaded by GW-BASIC is a
circular menuing system from which we can RUN all the other
GW-BASIC programs, or to shell to another professional
application completely.
Shelling out to other Applications
One of the displayed circular menus shells to Lotus 1-2-3
version 2.01 with HAL, dBase III+, Word, Works, Wordstar,
Professional Write and a host of other classic applications.
Altering the menuing system is very easy to accommodate your
favorite programs. as an aside, Computer Shopper had a gw-
basic menuing system in its publications around 1987
sometime... hey... that's only decades ago. you do save
your computer magazines don't you? :-)
The Main Menu
The first however, "mnu-main.bas" gets the most use in that
it just calls the rolodex, lister, recipes and other most
used programs that are written in GW-BASIC. You can go left
or right on the menuing circle by just pressing the F9 or
F10 function keys. That will rotate the ring around to the
menu that you want. If i remember, i made them different
colors so are to help with the mode problems. Of course you
can change colors if you want. as an aside, i am partially
colorblind so it is your call on my goofy colors.
If you Must
Running under Windows, the "Four Files of the Apocalypse"
can shell to other windows or DOS applications as well.
This is considered an "old fashioned" linking "mode" style
menuing system that is held somewhat in disfavor now by the
professional menu masters.
For me, the mode type user interface issues never surfaced
as an operating hindrance as the system is just too simple
to develop complexity.
Nor did i ever use the system 8 hours a day to develop that
type of finger-mind fatigue that always calls up the wrong
menu or operation within an application that brought this
type of menuing system into disfavor. So it works for me...
The Small File Requirement
The menuing system uses very small batch files when
necessary or very small GW-Basic programs to assist in
returning to the correct menu after the application is
closed.
Those small files are all collected into one file at the end
of the table of contents. so you may have to sort through
to find just the ones you need if you want to minimalize the
number of files on your system.
On your mark, get set, go...
The first small batch file switches to the appropriate
drive, then switches to your appropriate directory, in this
case, /FFA.
(which stands for the "Four Files of the Apocalypse")
The batch file then calls GW-BASIC and loads the main menu
called MNU-MAIN.BAS.
After you are through with the application and have exited
GW-BASIC, it calls another batch file called FAMILY.BAT.
FAMILY.BAT is simply the opening screen splash for our
family system. Family is of course totally optional.
The starting gun
The batch file is:
@echo off
cls
Drive letter (a-f) E:
cd\
cd ffa
gwbasic.exe mnu-main.bas
family
Where is the Path?
One note on the path requirements of DOS: any called
application from an alien directory absent from the path
must have the "Set path to: "drive/directory" environmental
variable assigned.
Ground floor, everybody out!
As you can see, after the mnu-main program is exited, the
batch file exits and transfers control to another batch
file, "family".
And we might as well dispose of that now, here is
"family.bat" for your alteration:
Oops!
ummm... i notice that i use Batch Enhancer from the
Norton Utilities 4.5 in addition to a standard ascii
file. if you don't have the old DOS program (BE)
sitting around anywhere, don't fret, this is just
icing on the cake and you don't need the opening splash.
You might find the old program or something similar using a
google search or checking on e-Bay.
Splash!
Here is the system splash starter file.
The file, menu-fam.doc is printed to the screen and then
over that is the Batch enhancer from Norton put to work.
@echo off
cls
c:
cd\
type c:\dus\menu-fam.doc
rem "be" is the norton batch enhancer program.
be window 2 20 4 59 explode shadow
be rowcol 3 28 "The ******* Family Menu" bri yellow
be window 15 20 20 59 explode shadow
be rowcol 16 25 "Please type your 3 initials" bri yellow
be rowcol 17 25 "or letters for your application" bri yellow
be rowcol 18 25 "and then press the enter key" bri yellow
be rowcol 22 1
hmmmm...
maybe i should just delete the above paragraph entirely.
oh well...
Here is a copy of MENU-MAIN.BAS
Oops! well, the high order ascii characters have to be
(well they don't have to replaced, it just looks prettier)
replaced with the line drawing characters using either
a search and replace function or an old copy of either
wordstar or professional write or any other editor that
will do the job. when i uploaded the menus into an HTML
file, the box drawing characters from the file got translated...
sigh... sorry.
First we reopen and clear the screen, turn off the keys, create
a month array, select a color, any color, and finally clear the screen
0 VIEW PRINT:KEY OFF:DIM M$(12):COLOR 11,4:CLS 'by fhb rev.d 9/17/98
(don't forget to include the above line zero (0) in the
menuing code below...)
assign some values to hour (HR) and Date$ (D$) and AMPM$
1 HR=VAL(LEFT$(TIME$,2)):D$=DATE$
2 IF HR>11 THEN AMPM$=" pm" ELSE AMPM$=" am"
3 IF HR>12 THEN HR=HR-12
4 IF HR=0 THEN HR=12
here we assign months to the m$() array.
i know, i know, i left m$(0) blank.
for alignment purposes, all the string values
in the array are the same length accomplished
with leading blanks. Makes it easier.
5 M$(1)=" January":M$( 2)=" February":M$( 3)=" March":M$( 4)=" April"
6 M$(5)=" May":M$( 6)=" June":M$( 7)=" July":M$( 8)=" August"
7 M$(9)="September":M$(10)=" October":M$(11)=" November":M$(12)=" December"
print a centered title
Note: you can do the (80 - len(title))/divide by two b.s.
but who needs it for our simple stuff.
8 PRINT TAB(20)"Welcome to the Four Files of the Apocalypse"
convert the hour number back to a string value and print it
print the main menu heading and all the month and year stuff.
DON'T forget the little apostrophe's (oops, semicolons!) at
the end there.. very important :-)
9 PRINT STR$(HR);":";MID$(TIME$,4,2);AMPM$;TAB(35)"MAIN MENU";
10 PRINT TAB(62) M$(VAL(MID$(D$,1,2)));" ";MID$(D$,4,2);", ";RIGHT$(D$,4)
move the cursor to line 21 row 1
11 LOCATE 21,1
next four lines print the boxes and what goes in them.
not strictly necessary but looks better.
DON'T FORGET THE APOSTROPHES er... SEMI-COLONS at the end
of the lines!
12 PRINT"������Ŀ������Ŀ������Ŀ������Ŀ������Ŀ������Ŀ������Ŀ������Ŀ������Ŀ������Ŀ";
13 PRINT"� HELP ��SSaver�� RCP �� ROLO �� CB �� Works�� exit ��LISTER��prior �� next �";
14 PRINT"��������������������������������������������������������������������������������";
15 PRINT" F1 F2 F3 F4 F5 F6 F7 F8 F9 F10";
create a scrollable window, put some color in it, clear that screen.
16 VIEW PRINT 3 TO 20:COLOR 11,1:CLS
Reassign the function keys to do different things
17 KEY 1, CHR$(27) + "RUN" +CHR$(34)+ "HELP-FFA"+CHR$(13)
18 KEY 2, CHR$(27) + "RUN" +CHR$(34)+ "SSAVER" +CHR$(13)
19 KEY 3, CHR$(27) + "RUN" +CHR$(34)+ "MNU-RCP" +CHR$(13)
20 KEY 4, CHR$(27) + "RUN" +CHR$(34)+ "ROLO" +CHR$(13)
21 KEY 5, CHR$(27) + "RUN" +CHR$(34)+ "CB" +CHR$(13)
22 KEY 6, CHR$(27) + "RUN" +CHR$(34)+ "2WORKS" +CHR$(13)
23 KEY 7, CHR$(27) + "RUN" +CHR$(34)+ "EXIT" +CHR$(13)
24 KEY 8, CHR$(27) + "RUN" +CHR$(34)+ "LISTER" +CHR$(13)
25 KEY 9, CHR$(27) + "RUN" +CHR$(34)+ "MNU-APPS"+CHR$(13)
26 KEY 10,CHR$(27) + "RUN" +CHR$(34)+ "MNU-LETR"+CHR$(13):'NEW
the last line below is an embedded 'save' command that is
commented out so you don't have to remember or misremember
what file you are working on. after making your edits just
delete the leftmost line number until the apostrophe is gone
and save the file by pressing enter.
27 ' SAVE"MNU-MAIN.BAS",A
that's it.
Most other programs in the "last book of gw-basic" follow
the same format more or less. some have extensive embedded
commands depending on the length of the file and the number
of subroutines. it is a handy feature of the gw-basic
interpreter. makes the program a lot easier to debug or
edit later when you don't even remember writing the program
in the first place. :-( what's this?
Go to the TOP of the document
Go to the GW-BASIC Table of Contents
Back to Frankenbook's Table of Contents.