home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Generous Efforts of Many
/
gemcd.zip
/
GEM.CD.A.po
/
FEATURES:BEAGLE
/
BEAGLEBASIC.DOC
/
T.BEAGLE.BASIC
Wrap
Text File
|
1990-02-15
|
33KB
|
861 lines
BEAGLE BASIC INSTRUCTIONS
-------------------------
What is BASIC?
--------------
BASIC is your Apple's native language. Apple IIe's and
II+'s are equipped with Applesoft Basic, while ancient (pre-
1980) Apple II's came with Integer Basic hardware.
Applesoft, by far the most common "resident" language,
determines exactly which words (or "commands") your Apple
understands. It also determines what actions your Apple
will take when each command or combination of commands is
typed. Since Applesoft is stored in ROM (Read-Only Memory),
it is normally unchangeable. The abilities and vocabulary
given to your Apple by Applesoft are set in concrete.
Permanent. Period.
What is BEAGLE BASIC?
---------------------
Beagle Basic is a set of programs that let you enhance
Applesoft and use new commands and features in your
programs. It also lets you rename standard commands and
error messages, for whatever reason you might have. Beagle
Basic gets around Applesoft's "permanency" by moving it from
ROM into RAM (Random-Access Memory) or changeable memory.
A NEW BASIC IN AUXILIARY MEMORY
-------------------------------
When you boot a System Master disk on an Apple IIe (or an
Apple II or II+ with a RAM card), the Hello program loads
the "other" BASIC (Applesoft or Integer, whichever one is
not built into your Apple) into memory "above Apple's normal
48k. On an Apple IIe or II+, you would then have Applesoft
in ROM and Integer in RAM. You can switch between these two
languages with DOS's FP and INT commands.
Well, don't tell anyone where you read this, but Integer
Basic is a worthless dinosaur! Nobody writes programs in
Integer anymore. Yeah, sure, it's faster than Applesoft and
it has a MOD function, but look at all it's missing. (See
Appendix M of the Applesoft II Reference Manual or Appendix
L of the equivalent IIe Manual.)
So, let's not load Integer as our second language in RAM.
Instead, let's put an enhanced version of Applesoft, called
"NEWBASIC", there. Newbasic is loaded into memory by the
"NEWBASIC LOADER" program, select the Applesoft enhancements
that you want and save them on disk as "Newbasic". Just
like you can use cousin DOS Boss to change DOS, you can
alter Apple's Applesoft vocabulary, and modify the way the
Apple behaves when commands are typed. Beagle Basic gives
you options of twenty brand new commands and two modified
commands.
If you program in Applesoft, you're going to have some fun
with Beagle Basic.
How to Use Beagle Basic
-----------------------
Your original Beagle Basic disk is a normal DOS 3.3 disk.
You can boot it, catalog it, save to it...and run it- Make a
back-up copy please.
Beagle Basic requires your Apple to have at least 64k of
memory. If you have an Apple IIe, you are set. If you have
an Apple II or II+ (normally 48k), it must be equipped with
extra memory in the form of a RAM card (or "language"
card").
ENHANCING APPLESOFT
-------------------
Before you can program with Beagle Basic's new features, you
must first enhance Applesoft, then save the enhanced version
on disk under the name "NEWBASIC". Here's what you do:
1. Boot the Beagle Basic disk.
2. Run the program called "CREATE NEWBASIC",
3. Use CREATE NEWBASIC to customize Applesoft by
changing its vocabulary and adding new commands.
4. Save your enhanced version of Applesoft on disk
under the name "NEWBASIC".
USING NEWBASIC
--------------
To use your version of Newbasic, you must run the program
called "NEWBASIC LOADER", which will load NEWBASIC into your
Apple's auxiliary memory (our way of saying "RAM card" or
language card" or "bank-switched memory").
ENHANCING APPLESOFT WITH BEAGLE BASIC
CREATE NEWBASIC
---------------
CREATE NEWBASIC is the program on the Beagle Basic disk that
lets you customize Applesoft and/or save it onto disk under
the name "NEWBASIC". Boot the Beagle Basic disk and select
(C), the CREATE NEWBASIC option, from the menu, or (Q),
Quit, and type:
RUN CREATE NEWBASIC (return)
Create Newbasic's first job is to load some form of
Applesoft (modified or unmodified) into your Apple's
auxiliary memory. Here's what happens when Create Newbasic
runs:
A. Create Newbasic will look for some form of Applesoft
(normal or modified) in your Apple's auxiliary memory. If
found, step D is next.
B. Create Newbasic will look on the disk for a modified
Applesoft file called "NEWBASIC" to be loaded into auxiliary
memory. Note: This file was not on your original disk (see
page 3). If found, step D is next.
C. Create Newbasic will give up and transfer Applesoft from
its normal ROM location into auxiliary memory.
D. Create Newbasic will now display its Main Menu.
THE MAIN MENU
-------------
Create Newbasic's Main Menu offers you five Applesoft change
options on the screen, plus Save and Quit. Details for each
option are printed on the page shown:
(C) COMMAND EDITOR............page 13
(E) ERROR MESSAGE EDITOR......page 15
(L) LIST FORMATTER............page 5
(B) ADD NEW BASIC COMMANDS....page 6
(O) OTHER FEATURES............page 11
(S) SAVE NEWBASIC.............page 11
(Q) QUIT......................page 11
You can usually return to this Menu from Create Newbasic's
various modes by pressing the ESC key or 1 (see keychart
notes on page 12).
COMMAND EDITOR
--------------
Every Applesoft command may be renamed to almost any word
you want. See "Changing Commands and Error Messages" on
page 12 for instructions.
ERROR MESSAGE EDITOR
--------------------
Applesoft error messages may be reworded too, for clarity or
just for fun. See "Changing Commands and Error Messages" on
page 12.
LIST FORMATTER
--------------
Selecting option L from the Main Menu presents you with
three choices for changing Applesoft's rigid list format.
Typing the letter (A,B or C) turns the corresponding feature
On or Off ("YES" or "NO" printed in inverse) in your Apple's
memory.
(A) INVERT REM STATEMENTS
-------------------------
This is the most useful list-format option. Turning this
feature On ("YES") causes your program remark statements to
be displayed in inverse type when listed. The word "Rem"
will be inverse too (try renaming it to "]" to tone it down
a bit).
(B) CHANGE LIST WIDTH
----------------------
The width of your listings can be altered to be from 1 to 40
characters wide. Normal is 33. Select option B and enter
the width you want to try. If you change the list-width to
40, extra spaces won't be added in quote statements, and you
won't have to POKE 33,33 before ESCaping editing.
(C) LIST INDENTATION
--------------------
The list indentation under each program line number may be
changed from the standard 5 to any value from 0 to 39.
Select C and enter the number you want to try. The less the
indentation, the more code you can squeeze on the screen.
ADD NEW BASIC COMMANDS
----------------------
Newbasic gives your Apple more power by offering twenty
all-new commands and two slightly-new ones, each one
completely optional. Since the machine-language
instructions for every command must occupy a certain amount
of memory space (the amount depends on the complexity of the
command), memory is "stolen" by writing over the space used
by the least-used Applesoft commands. I'll bet my $64.95
joystick that you never use the cassettes at all? Applesoft
has several cassette commands that waste space. Let's put
all that space to better use.
Here is a list of optional Newbasic commands and the old
Applesoft ones that they replace. Type the letter to the
left of the command to turn it On or Off ("YES" or "NO" in
inverse). And remember, these commands may be renamed any
time you want. See page 12.
(A) ELSE (replaces cassette SHLOAD command)
-------------------------------------------
We've saved the best for first. ELSE is a common command in
many programming languages, but missing from Applesoft until
now. It completes the IF-THEN statement but remains
optional. This is how you use ELSE:
10 PRINT "TYPE Y OR N";:GET A$
20 IF A$ = "Y" THEN PRINT "YES": ELSE PRINT "NO"
ELSE Makes Applesoft more "English-like" and friendly. It
omits the need for another program line after an IF
statement.
Notice how ELSE's may be nested just like for-next loops:
10 PRINT "TYPE Y OR N: ";: GET A$: PRINT
20 PRINT "TYPE 1 OR 2: "; GET B$: PRINT
30 IF A$ = CHR$ (3) OR B$ = CHR$ 9#) THEN END
40 IF A$ = "Y" THEN PRINT "YES":
IF B$ = "1" THEN PRINT "ONE":
ELSE PRINT "TWO":
ELSE PRINT "NO":
IF B$ = "1" THEN PRINT "ONE":
ELSE PRINT "TWO"
50 GOTO 10
The next two commands replace the cassette LOAD and SAVE
commands, not DOS's LOAD and SAVE. The commands "LOAD
filename" and "SAVE filename" will still work fine.
(B) SWAP (replaces cassette LOAD command)
-----------------------------------------
Here's the normal way to swap variable values X & Y:
TEMP=X: X=Y: Y=TEMP
Notice how a third variable was necessary (and an extra
split-second of execution time). SWAP makes swapping
(common in many sorting routines) much simpler.
10 A = 1.11:B = 2.22: PRINT A,B
20 SWAP A,B: PRINT A,B
30 SWAP A,B: PRINT A,B
Notice that you can SWAP not only variables, but integers,
strings, array values, and combinations of the above:
10 A% = 1.B% = 2:PRINT A%,B%
20 SWAP A%,B%: PRINT A%,B%
30 SWAP A%,B%: PRINT A%,B%
10 A$ = "A": B$ = "B": PRINT A$,B$
20 SWAP A$,B$: PRINT A$,B$
30 SWAP A$,B$: PRINT A$,B$
10 A(1) = 1:B(1) = 2: PRINT A(1), B(1)
20 SWAP A(1), B(1): PRINT A(1),B(1)
30 SWAP A(1), B: PRINT A(1), B(1)
10 A(1) = 1:B = 2: PRINT A(1),B
20 SWAP A(1),B: PRINT A(1),B
30 SWAP A(1),B: PRINT A(1),B
(C) TONE (replaces cassette SAVE command)
-----------------------------------------
Use TONE to play music without having to use any clunky
Pokes or Calls. To play a note, use this command:
TONE P, L
The note's pitch P may be any value from 0 to 255. The
length L may range form 0 to 65535. Some complete song
recipes are printed in the tips section of this book.
(D) HSCRN (replaces cassette RECALL command)
---------------------------------------------
HSCRN tells you the "color" of any hi-res coordinate. If
performs similarly to lo-res's SCRN (function. Just type
"HSCRN" followed by the hi-res coordinates you want to
check. Then "PRINT PEEK(234)". 0(Zero) means the point is
black (off). 1. means the point is white (on). For
example, to check location 275 (X), 10(Y), do this:
HSCRN 275, 10: PRINT PEEK (234)
Here is a program that shoots a white "bullet" at a white
line. Give it a try:
10 HOME : TEXT : HGR : PRINT "POW!!!": PRINT
15 X = 17:Y = INT ( RND (1) * 99) + 5
20 HCOLOR = 3: HPLOT 0,Y to 279,Y
30 FOR Y = 159 TO 1 STEP - 1
40 HSCRN X,Y:HIT = PEEK (234)
50 IF HIT THEN PRINT "A HIT!": HPLOT 12,Y - 3 TO
18,Y + 3: HPLOT 12,Y + 3 TO 18,Y - 3: END
60 HCOLOR= 0: HPLOT X,Y + 1
70 HCOLOr= 3: HPLOT X,Y: NEXT
Since Apple's hi-res colors are made up of black and white
dots (the program below proves it by reading each dot in a
green line), you won't be able to determine any colors with
HSCRN.
10 HOME : TEXT : HGR
20 HCOLOR= 1: HPLOT 0,99 TO 279,99
30 FOR X = 0 TO 279: HSCRN X,99
40 PRINT PEEK (234);: NEXT
(E) SCRLDN (replaces cassette STORE command)
---------------------------------------------
Each SCRLDN command scrolls the text screen down one line,
not a common occurrence these days.
10 TEXT : HOME : NORMAL
20 PRINT "STAND BY. I'M POLISHING THE TV SCREEN..."
30 FOR I = 1 TO 23 : SCRLDN : NEXT : VTAB 24
40 FOR I = 1 TO 23 : PRINT : NEXT : GOTO 30
NOTE: Selecting "YES" to add a new function automatically
replaces some old command in the Command Editor. After
that, you may rename the new command if you want. View
changed commands with options C (from the Main Menu) and 6
or 7 (see keychart).
The following two commands replace BASIC's IN# and PR#
commands, not to be confused with DOS's IN# and PR#. It is
always best to use the DOS versions of these commands from
within programs. For example, PRINT CHR$(4)"PR#1"
(F) TXT2 (replaces Basic IN# command)
-------------------------------------
TXT2 reveals page 2 of text and lets you do everything there
that you can do on page 1.
Since Applesoft programs normally use the same memory space
that text page 2 uses, you must make your programs re-locate
(actually re-RUN) themselves. Do that by adding the first
line shown in this example. Warning: SAVE before you RUN!
10 IF PEEK (104) < 12 THEN POKE 104,12: POKE 3 072,0: PRINT
CHR$ (4) "RUN TEXT TEST": REM THIS PROGRAM
20 A$ = "PAGE ONE.": TEXT : HOME : GOSUB 90
30 A$ = "PAGE TWO.": TXT2 : HOME : GOSUB 90
40 VTAB 23: HTAB 22: GET A$: PRINT A$
45 IF A$ = "1" THEN TEXT : GOTO 40
50 IF A$ = "2" THEN TXT2 : GOTO 40
60 PRINT : PRINT "HUH?": END
90 FOR I = 1 TO 93: PRINT A$;: NEXT : VTAB22: PRINT :
PRINT " SELECT PAGE (1 OR 2):": RETURN
(G) G2 (replaces Basic PR# command)
------------------------------------
G2 works like GR but lets you access page 2 of lo-res. The
same rules apply for lo-res page 2 as for the text page 2
(see above).
10 IF PEEK 9104) < 12 THEN POKE 104,12: POKE 3 072,0:
PRINT CHR$ (4) "RUN LO-RES TEST": REM THIS PROGRAM
20 TXT2 : HOME : G2 :X = 8:Y = 9
30 FOR H = X TO 30 STEP 4: IF H < > 24 THEN FOR V = Y TO
13: COLOR= 5: HLIN H,H + 2 AT V: NEXT : COLOR= ): PLOT H =
1,10: PLOT H = 1,12
40 NEXT H: FOR I = 1 TO 10: READ H,V: PLOT X + H,Y + V:
NEXT : DATA 1,4,2,3,2,4,5,4,9,2,10,1,14,1,14,3,20,1,22,3
(H) CLRKEY (replaces Applesoft WAIT command)
--------------------------------------------
Use CLRKEY instead of POKE -16368,0 to clear the keyboard
buffer. Like this:
10 TEXT : HOME : PRINT ">";
20 KEY = PEEK ( - 16384) : IF KEY < 128 THEN 20
30 CLRKEY : REM TEST WITHOUT THIS COMMAND.
40 PRINT CHR$ (KEY - 128);: GOTO 20
Since options I, J, and K (below) replace the same set of
lo-res commands, only ONE of these options may be used at a
time. (For example, if option K displays "---/NO" instead
of "YES/NO", you need to turn OFF option I or J before you
can use K.)
(I) TEXT & BELL COMMANDS
-------------------------
(replace PLOT, HLIN, VLIN and COLOR=)
CLLN (for "CLear LiNe") replaces CALL -868 or ESC-E. Clears
a text line from the cursor position to the bottom of the
text window.
CLDN (for "CLear DowN") replaces CALL -985 or ESC-F. Clears
the text from the cursor position to the bottom of the text
window.
SCRLUP replaces CALL -912. Scrolls text up a line.
BELL replaces CALL -198 or PRINT CHR$(7). Rings Apple's
control-G bell. You can even customize the bell itself; see
next page.
(J) HI-RES COMMANDS
-------------------
(replace PLOT, HLIN, VLIN and COLOR=)
MODE1 replaces POKE -16304,0 (graphics switch).
MODE2 replaces POKE -16303,0 (text switch).
MIX0 replaces POKE -16302,0 (full- screen graphics).
MIX1 replaces POKE -16301,0 (split graphics & text).
PAGE1 replaces POKE -16300,0 (page 1 switch).
PAGE2 replaces POKE -16299,0 (page 2 switch).
RESL1 replaces POKE -16298,0 (lo-res switch).
RESL2 replaces POKE -16297,0 (hi-res switch).
(K) CURSOR COMMANDS
-------------------
(replace PLOT, HLIN, VLIN and COLOR=)
CRSU moves the cursor up one line.
CRSD moves the cursor down one line.
CRSL moves the cursor left one character.
CRSR moves the cursor right one character.
10 TEXT : HOME : HTAB 6: SPEED= 255
20 PRINT "<USELESS DATA. PLEASE FILE>"
30 VTAB 11: FOR I = TO 40: PRINT "-";: NEXT :SPEED= 150
40 N = INT (RND (1) * 3): IF N THEN S = PEEK (49200)
50 IF N = 0 THEN CRSU : REM CURSOR UP
60 IF N = 1 THEN CRSD : REM CURSOR DOWN
70 PRINT "+";: IF NOT PEEK (36) THEN 10: ELSE 40
Other Features
--------------
Two of the features below aren't really Applesoft changes;
they are monitor changes. But Newbasic doesn't care; add
them to your repertoire.
(A) ADD ESCAPE-CURSOR
----------------------
(Won't work properly with GPLE in memory)
The escape cursor indicates escape mode (moving the cursor
for editing with ESC, then I, J, K, and M) by changing the
cursor to a flashing plus sign. Any non-cursor key returns
the normal cursor unharmed.
(B) MODIFY BELL
---------------
Newbasic lets you change Apple's bell value to make
control-G sound lower with a longer duration, or higher
with a shorter duration. Any number, 1-99, may be entered,
but the most interesting values are between 10 and 30.
(C) MODIFY GOTO/GOSUB SYNTAX
----------------------------
Normally the GOTO and GOSUB commands must be followed by a
line NUMBER (as in GOTO 12345). Selecting YES to this
option lets GOTO and GOSUB precede a variable (as in GOTO
JAIL) or an expression (as in GOSUB X+10).
10 LOOK = 100:BOOGIE = 200:MARINE = 300:HALT = 66
20 GOSUB LOOK: GOSUB BOOGIE: GOSUB MARINE
30 FOR I = 1 TO 3: GOSUB I * 100: NEXT : GOTO HALT
40 PRINT "DON'T PRINT THIS."
66 STOP : REM PRINT "BREAK IN 66"
100 PRINT "THIS IS LINE 100.": RETURN
200 PRINT "THIS IS LINE 200.": RETURN
300 PRINT "THIS IS LINE 300.": RETURN
Save Newbasic
-------------
Once you have configured Applesoft the way you want it, you
can save the set-up on disk under the name "NEWBASIC".
Select S from the Main Menu. (If you already have a file
named "Newbasic" that you want to keep, exit the program
now, RENAME it, type "RUN" and select SAVE for the Main
Menu.)
Quit
----
You may exit Create Newbasic by typing Q from the Main Menu.
If you haven't saved the current Basic, you will be notified
after quitting. To save after quitting, type "RUN" and then
select option S.
Changing Commands and Error Messages
------------------------------------
One of Beagle Basic's most interesting features is the
ability to change Applesoft's usually rigid commands and
error messages. Run the CREATE NEWBASIC program and select
C or E from the Main Menu (see page 4).
1: MAIN MENU
------------
Return to the Main Menu (see page 4) from Create Newbasic's
various modes by typing 1 as noted on the keychart or by
pressing ESC.
2: EDIT (Commands or Error Messages)
------------------------------------
While in the Command or Error Message Editor, move the
cursor to the command or message you want to edit (change),
select keychart option 2 and type a new word or words and
press Return. The new command or error message will
immediately be in effect. To confirm this, you may return
to the Main Menu (1), quit (Q) and give it a try. Usually
you can run return to Create Newbasic by typing "RUN". If
you somehow zapped it with your test, you may have to type
"RUN CREATE NEWBASIC."
Changing Commands
-----------------
To change any Applesoft command, or to see the commands
currently in effect, type C from the Main Menu. You will
enter the COMMAND EDITOR and the screen will be filled with
the current Applesoft commands or "keywords" - that is,
every word that you can type that your Apple will understand
(except disk or DOS commands like CATALOG, UNLOCK, INIT, and
so on).
MOVE MODE: In the upper-left corner of the screen you will
see the word "MOVE". This means you are in the "Cursor-Move
Mode". The cursor is the inverse bar over one of the
commands. To move this cursor, use the Left & Right Arrow
Keys and the Up & Down Arrow Keys (or use A & Z for up &
down if you don't have an Apple IIe). Move the cursor
around now. I'll wait here...
FREE CHARACTERS: The number after the word "FREE" in the
upper-right corner of the screen indicates the number of
spare characters remaining in the command table. For
example, if you shorten the INVERSE command to "INV", you
increase the number of free bytes by 4. If you change LET
to "ASSIGN", you reduce the number of free bytes by 3. You
cannot lengthen a command if you have no spare characters;
you must shorten another command first. No command longer
than the cursor, seven characters, is allowed.
EXPERIMENT: Change the HOME command to "CLS" (many
languages use CLS to mean "Clear the Screen").
1. After running Create Newbasic, select the Command
Change Mode (C) from the Main Menu. You will see
the current 107 commands on the screen.
2. Use the Arrow Keys or the FIND option (page 16) to
move the cursor the HOME (the 5th command down in
the 4th column).
3. Type 2 to edit the word. The word "EDITING" will
appear in the upper-left corner of the screen, and
the bar-cursor will change to a blinking square.
4. Type "CLS" as the new command, and press Return.
That's it! You have changed the HOME command to "CLS". You
are now back in the Move Mode and the free characters
(upper-right of the screen) have been increased by one
because "CLS" is one character shorter than "HOME". Later
on, typing "CLS" will clear the screen. If you type "HOME",
your Apple will grumble "?SYNTAX ERROR" (Computerese for
"Never heard of it!").
To shorten INVERSE to "INV", move the cursor to INVERSE (7th
word in the 1st column), and press 2 to edit. Use the Right
Arrow key to trace over the I, N, and V, and hit Return.
Easy, right? And you have gained four more spare
characters. Later on, typing "INV" will create inverse type
as expected. Typing "INVERSE", however, will print "?SYNTAX
ERROR" in inverse, because your Apple tokenized "INVERSE"
into two words; "INV" (which it recognized and executed) and
"ERSE". "Erse" means nothing to most Apples, so ?SYNTAX
ERROR.
COMMAND RULES: New commands may contain no spaces, lower
case or control characters. Other than that, all characters
are legal. The position of the Caps Lock Key on the IIe has
no bearing on input; all keystrokes are interpreted as upper
case. Pressing rEturn will accept whatever has been entered
up to the cursor. If the cursor is on the leftmost
character in a command when you press Return, no change will
occur.
COMMANDS WITHIN OTHER COMMAND NAMES can be a problem if you
don't watch out. For example, notice how HGR2 comes before
HGR in the command table. If it didn't, and you typed
"HGR2", Applesoft would scan the table, find "HGR" first,
quit scanning and "parse" HGR into two words, "HGR" and "2".
If you want to create a command name (like "GONOW") that
starts with the same characters as another command (say
"GO"), always put the longer command first in the command
table. Commands that end with the same characters (like
PLOT and HPLOT) are no problem.
NOTE: You can test new commands and functions by quitting
Create Newbasic (Main Menu option Q). Re-enter the program
by typing "RUN" or "RUN CREATE NEWBASIC". Be sure to SAVE
(Main Menu option S) and version of Newbasic that you want
to keep.
Changing Error Messages
-----------------------
Selecting option E from the Main Menu will enter the ERROR
MESSAGE EDITOR which displays and lets you change Applesoft
error messages, the words your Apple prints when an error in
encountered. Operation of the Error Message Editor is
similar to that of the Command Editor. Differences are
pointed out below:
EXPERIMENT: Change the message ?SYNTAX ERROR to "?TYPING
GOOF!"-
1. Select the Error Message Change Mode, E, from the Main
Menu. you will see the current 17 Applesoft error messages
on the screen, as well as the words "ERROR", "IN" and
"BREAK".
2. Use the Arrow Keys to move the cursor to SYNTAX (the 2nd
error message down). Notice that word "ERROR" appears near
the bottom of the screen and must be changed separately.
(The "?" that precedes Applesoft error messages may be
changed too. See the tip on page 32.)
3. Type 2 to edit the message. The word "EDITING" will
appear in the upper-left corner of the screen, and the
bar-cursor will change to a blinking square.
4. Type "TYPING" and hit Return.
5. Move the cursor to ERROR, third word form the bottom,
type 2 to edit, type "GOOF!", and hit Return.
You have officially changed the ?Syntax Error message to
"?Typing Goof!" Later on, typing an illegal statement (my
favorite is "Sdjaflkfd") will produce a well-dressed ?Typing
Goof! message and a beep. The word "Goof!" will now follow
every Applesoft error message. Since "?Illegal Quantity
Goof!" and "?Out of Data Goof!" don't make a lot of sense,
you may want to not change the word "Error".
ERROR MESSAGE RULES: The Error Message Editor is not
concerned with spare characters, because there are no spare
characters; each error message is already at its maximum
length (the length of the cursor). Other rules are the same
as for commands, except spaces are legal in error messages.
"IN" and "BREAK" appear in messages like BREAK IN 1234, and
may be changes.
3: FIND (Commands only)
-----------------------
From the Command Editor, typing a 3 will print the word
"FIND:" on the screen. Enter any command's name and the
cursor will move to that command. If the search is
unsuccessful, the cursor will stay where it was. It's not
necessary to type an entire command. For example, if you
type "X" and press Return, the cursor will position itself
at the first command that starts with an "X".
4: SORT (Commands only)
-----------------------
Pressing 4 will temporarily sort (alphabetize) the commands
on the screen. If you want to send this list to your
printer, press 0 (see next page). Pressing any key (like
the Space Bar) returns the command order to normal, the
order (left to right) in which they are stored in memory.
Sorting lets you check to make sure you have not given the
same name to two or more different commands. Doing so would
disable one of those commands.
Giving a BASIC command a DOS command name could possibly
have the same effect. To play it safe, never give a BASIC
command a word that DOS uses- APPEND, BLOAD, BRUN, BSAVE,
CATALOG, CHAIN, CLOSE, DELETE, EXEC, FP, INIT, INT, IN#,
LOAD, LOCK, MAXFILES, MON, NOMON, OPEN, POSITION, PR#, READ
RENAME, RUN, SAVE, UNLOCK, VERIFY, or WRITE.
5: TOKEN NUMBER (Commands only)
-------------------------------
Pressing 5 while in the Move Mode will print the word
"TOKEN" at the upper-left of the screen, erase the command
at the cursor and replace it with the hex and decimal values
for that command's "token". Tokens are the numbers
Applesoft assigns each of its keywords. Pressing any key
(like the Space Bar or Return) will return you to Move Mode.
6: HIGHLIGHT CHANGES
--------------------
(Commands or Error Messages)
Pressing 6 will show you the changes that you have made.
All non-standard commands or error messages (if any) will be
highlighted in inverse. The word "CHANGED" will appear in
the upper-left corner of the screen. Press any key to
return the Move Mode.
7: HIGHLIGHT STANDARD
---------------------
(Commands or Error Messages)
Pressing 7 will show you the standard version of each
command or error message (if any) that has been changed.
The word " STANDARD" will appear in the upper-left of the
screen, and the original commands or error messages will
appear in inverse. Press any key to return to Move Mode.
8: NORMALIZE (Commands and Error Messages)
------------------------------------------
Typing 8 followed by a Yes (when asked for approval) will
normalize the names of all commands OR error messages
(depending which is on the screen), setting them to their
original state. If, for instance, you wanted to change new
commands CLS and INV back to standard "HOME" and "INVERSE"
you could use this function. BEWARE that all other command
or error message changes will also be undone. NOTE that
standardizing all command names DOES NOT standardize (or
change in the least) the function of any command. For
example, if you have turned on the ELSE function (page 6),
the command name ELSE will be standardizing to "SHLOAD" but
the function of the command SHLOAD when executed in a
program will still be that of ELSE. Confusing? Yes. Until
you think about it for a week or so...
The last two keychart commands involve your printer. If you
don't use a printer, don't use keychart options 9 and Zero.
If your printer is connected to other than Slot 1, change
the SLOT variable in Line 3 of the CREATE NEWBASIC program.
9: PRINT OLD/NEW
----------------
(Commands or Error Messages)
Selecting 9 after entering the command Editor or Error
Message Editor will send a listing of all standard and
revised Applesoft commands or error messages to your
printer. Hex and decimal token numbers are printed adjacent
to commands. You must be in the Command Editor or Error
Message Editor to use this function.
0: PRINT SCREEN
---------------
Selecting 0 (zero) will dump the current text screen to your
printer. The most common use for this feature is printing
an alphabetized list of commands (keychart option 40.
although it may be used anytime.
Beagle Basic and the Token System
---------------------------------
Applesoft has a 107-word "command table" stored in memory
that contains "keywords" (words like PRINT, HOME, FOR,
GOSUB, and so on) that are used by Applesoft programs. For
efficiency, every keyword is represented by a one-byte
"token" or number. For example, instead of storing the
command "PRINT" as five characters or bytes (P, R, I, N and
T), it is stored as one byte- the value 186 (hex $BA).
When you type in a command like-
HOME: PRINT X; "ABC"
Applesoft converts all of the keywords into tokens by
looking at its command table. Words that aren't recognized
and characters between quote marks are represented by the
ASCII value of each character. Like this:
HOME is tokenizes as 151 ($97)
":" Becomes 58 ($3A, the ASCII value of ":")
PRINT is tokenized as 186 ($BA)
X becomes 88 ($58, the ASCII value of X)
; becomes 59 ($3B, the ASCII value of ;)
" becomes 34 ($22, the ASCII value of ")
A becomes 65 ($41, the ASCII value of A)
B becomes 66 ($42, the ASCII value of B)
C becomes 67 ($43, the ASCII value of C)
" becomes 34 ($22, the ASCII value of ")
So a program is simply a series of tokens and ASCII values.
What words are displayed when you list depends on the words
in the current command table.
Beagle Basic lets you change the contents of the command
table by renaming keywords and storing the new words in
memory. Let's say you change the keyword word "HOME" to
"CLS". Now when you type "HOME", Applesoft won't recognize
it, and CLS will clear the screen. BUT if you load a
program that contains the old HOME command (actually just
the token for HOME) and you list it, you will see that CLS
has automatically replaced each occurrence of HOME.
OR if you change HOME to CLS, and write a program full of
CLS's, it will work fine with your version of Newbasic. If
you now re-boot and use normal Applesoft, your program will
still work, even though all of your CLS's will list as
HOME's.
New FUNCTIONS Need Newbasic!
----------------------------
Changing names of commands is one thing, but adding new
functions like ELSE or SWAP or TONE is another story. For
these new functions to work properly, you MUST have the
correct version of Newbasic loaded into memory. Otherwise,
the machine language instructions that enable Applesoft to
execute these functions just aren't there. Running a
program with non-standard Applesoft commands without
Newbasic loaded will produce unpredictable results.
Exiting Newbasic- APPLE II+ AND IIe
There are two ways to exit Newbasic and re-instate normal
Applesoft;
1. Boot with a normal disk. This is the "cleanest" way to
leave Newbasic, because it completely normalizes your
system.
2. Or type, "INT". This command will switch you to Integer
Basic. With Newbasic in effect, INT instead switches you to
Applesoft (without erasing your program) and prints
"Language Not Available" on the screen (Integer wasn't
found). If you want, you could use DOS Boss to rename "INT"
to "ROM" and "Language Not Available" to "Applesoft
Available" or something else appropriate.
NOTE: Pressing RESET will always leave you in Newbasic with
your program intact. FP will also always leave you in
Newbasic, but with your program gone.
Exiting Newbasic- Apple II (Integer machines):
There are two ways to exit Newbasic and re-instate normal
Integer Basic in your antique Apple:
1. Boot with a normal disk. This is the "cleanest" way to
leave Newbasic, because it completely normalizes your
system.
2. Type "INT". This command will switch you to Integer Basic
and erase your program.
NOTE: FP will return you to (or leave you in) Newbasic with
your program gone.
GPLE and Newbasic
-----------------
GPLE is compatible with Beagle Basic except for the
following things. Let us know if you find more.
Thing #1: If you are using GPLE on the language card (GPLE
version PLE.LC), it must be loaded before Newbasic is
loaded.
Thing #2: Using the INT command with Newbasic and PLE.LC
loaded won't exit Newbasic as described above. Don't use
INT.
.
Thing #3: Newbasic's ESCape cursor won't function properly
with GPLE in memory. Sorry.
Normal Location DOS Required
----------------------------
DOS can't be in auxiliary memory (RAM card or language card)
when using Newbasic. There isn't even almost enough room.