This is a list of changes to the Basic Interpreter.  Changes are
listed chronologically by date.

early March

My calculation routines were not processing parentheses correctly. 
This problem has been fixed.

Variable names were not previously checked for validity in all
cases.  This process has been moved to the compile stage.  So
variable names are checked for validity in all cases before the
program even runs.

Most error checking now takes place in the compile stage.  For
loops, while loops, and most syntax errors are now trapped in the
compile stage.

While loops weren't nesting correctly.  That problem has been
fixed.

The maximum length for strings is now 126 characters.  The maximum
length for variable names is 40 characters which includes the
optional $.  Program lines can now be up to 128 characters long.

The program now returns an error when attempting to write to a
write-protected file.

A delete command has been added which allows the deletion of files.


March 11, 1995

A rename command has been added which allows the renaming of files.

Serial I/O has been implemented.  The three main I/O commands,
(print, input, and get) are preceded with an s when using the
serial port.  Thus, to print text to the serial port, the command
is sprint, to get a line of text from the serial port, the command
is sinput, and to get a character from the serial port, the command
is sget.  The serial port is automatically turned on when these
commands are invoked.

The main speech output has been changed from using API_SAY to using
API_SAY_WAIT.  This makes programs behave more predictably.

The off command has been added.  This command takes no arguments,
and simply turns off the speaker.

The say command has been added.  When using the Braille Lite, it
works exactly like the print command, except that it only speaks
the text, and doesn't display it on the Braille display.  When
using a BNS or TNS, it works identically to the print command.

The Braille command has been added.  When using a Braille Lite,
this command works identically to the print command, except that it
only displays the text on the Braille display and does not speak
it.  When using a BNS or TNS, it works identically to the print
command.

The run and compile modules both now accept command line arguments.

The compile.bns program accepts either one or two arguments.  If it
is passed one argument, then this argument is assumed to be the
name of the source file, and the destination file name defaults to
the source name with a .bas extension.  If it is passed two
arguments, the first is considered the source file name, and the
second is considered the destination file name.  If no arguments
are passed to the compile program, it only prompts for the source
file name.
The run.bns program accepts one argument, which is the name of the
program to run.  If no extension is specified, a .bas extension is
assumed.  If no argument is passed to the program, it will prompt
for the file name.

The compile module has been greatly improved!!  It now
automatically backtranslates grade2 files.  It now also ensures
that the lines are in the correct order, and checks for duplicates,
returning an error if any are found.  It also had a bug which
caused it to hang on some lines.  This has been fixed.  It now also
ensures that lines are not more than 128 characters long, the
maximum line length.

The rem statement was listed in the command reference, but in fact,
didn't exist in the last version.  This was due to an internal
change which I made, and then forgot to replace the rem command. 
My apologies!  It's here now!

The gosub command wasn't working properly.  Those problems were
fixed.

Read statements were either not reading any data, or causing the
system to hang.  This problem has been fixed.

The variable table was not getting reset every time the program was
run.  This problem has been fixed.


March 13, 1995

General clean-up work.  All processes can now be aborted with z-
chord on the BNS/TNS, and the escape key on the TNS.  When aborting
program execution, the number of the line at which execution was
haulted is announced.

If and while expressions are now vallidated in the compile stage.

The speaker is now turned off during compilation.

Some primitive checking that should work in most cases has been
implimented so that the run.bns program will not attempt to run
files that are not basic programs.


March 27, 1995

I did not know that the ^ symbol was still implimented as the
exponential function.  The code for the pow() function took about
one K.  this has been removed, in preparation for the
implimentation of the new API calculator call.

Assignment statements were not previously error checked because I
assumed that all variable error checking should take place in the
compile stage.  this is true.  However, array access errors can
occur during assignment statements, so assignment statements are
now error checked at runtime.

String variables are now checked to make sure that their contents
will not overflow the available memory.

The message in the compiler "Compiling, please wait." has been
changed to simply "compiling."


March 29, 1995

Well, apparently, the rem statement was still not implimented in
this revision.  I've implimented it, and removed some unnecessary
code from the run.bns program.  the code was the routines for the
vtab and htab commands, which are totally useless on the BNS, TNS,
or Braille Lite.

Rem statements are not compiled at all.  Only the line references
are saved.

The compiler was returning a syntax error when attempting to assign
a value to an element of a character string array.  This has been
fixed.

The stack size has been set to three K.

The speech routine was changed back to API_SAY.  I didn't like the
sluggish performance that API_SAY_WAIT delivered.  This may need to
be changed, due to the strange way in which some commands such as
the off command operate.  For example, if an off command dirrectly
follows a print command, the speaker will be turned off, and then
the text will be spoken, due to the fact that the off command was
executed before the text got a chance to be spoken.


March 31, 1995

Status clicks were implimented into the compiler.  they are
currently triggered by a two second timer, but still seem a bit
irregular.

The randomize() function was not previously called before programs
were run.  This resulted in the same random seed being used every
time.  this error has been corrected.

I had removed the preprocess() function call from the program while
doing some testing, and forgotten to put it back in the program. 
this error has also been corrected.

When inputting text to a character string, no text would be stored
if the inputted text began with a quotation mark.  Quotation marks
are now ignored when inputting in character strings.


March 31-April 1, 1995

I did a major overhall of the internal structure of the programs. 
Strings are now saved in compiled programs as true strings, rather
than character arrays.  The standard C string is simply a character
array, ending with a null character.  A true string, which is what
we use now, is a series of characters, preceeded by one byte which
contains the length of the string.  theoretically, this should
speed up program execution, but I have only seen a minimal
improvement in program execution speed at best.

     Important note:
Any programs compiled under previous test revisions will not run
under this version!!!  You must recompile the source code using the
current version of the compiler.

I made some runs at improving the speed of both programs today by
attempting to use the heap to define a memory chunk to store the
basic program and variable data in, but had no luck.  If this is
possible, it will reduce the run.bns program size to around fourty-
five K, and allow us to use a data area of around 18 K, which
should be enough to hold both a basic program, and all the variable
data it needs, thereby speeding up program execution.  We should
also be able to impliment a similar setup for the compile.bns
program.


April 4, 1995

I noticed that the end of files was not detected.  this was due to
a small error in the code of the run.bns program which has been
fixed.

In order to maintain compatibility with GWBASIC, the convension of
allowing the apostrophee to signify remarks has been adopted. 
Therefore:

'This is a comment
is the same as
rem this is a comment

Also in keeping with the conventions of GWBASIC, the inkey$
function has been implimented.  The value of inkey$ can be assigned
to another variable, but no value can be assigned to inkey$.  the
value of inkey$ contains the current value in the keyboard buffer. 
therefore, if no keys are buffered, inkey$ will be equal to "".  If
a chord key is buffered, inkey$ contains a character string of two
characters.  the first character is the percent sign, and the
second character is the upper-case value of the chorded character. 
For example, if z-chord were pressed, inkey$ would contain "%Z".

The left$ and mid$ functions were included in previous revisions. 
Now the right$ function has been added to complete the set.

Function names such as len and str$ are no longer vallid variable
names.  It was previously possible to have a line such as:
10 str$ = "hello"

The compiler would accept this, even though it was invallid, since
str$ is actually a function.  Even though and and or are not
functions, they are key words, and are included in this exclusion.

Due to the addition of inkey$, the abort checking routines in the
run.bns program were rewritten.  the program now uses an internal
16-key buffer to store input while basic programs are doing things
besides reading input.  Nothing is output to speech when there are
buffered keys.  Therefore, you can now interrupt a basic program
while it is talking by typing, and have it behave correctly.  This
was an unintensional benefit of this modification.

The run.bns program will no longer allow an already dimmed array to
be redimmed.  The redimmed error has been added, its code is 30. 
Also, trying to dimension an array with the same name as an already
existant variable will result in a syntax error.

The pronounciations of all the messages spoken by the program have
been corrected.

The run.bns and compile.bns programs now have sign on messages if
they are executed without any command line arguments.  They also
provide help from the files menu.  The help info also gives the
date of the revision being run.

The programs were not allowing the user to abort from the "Enter
program to run" or "Enter source file name" prompts.  this problem
has been fixed.

The inkey$, left$, mid$, and right$ functions and their
descriptions were added to the commands.txt file.


April 9, 1995


The delete command would not previously accept a variable name as
an argument.  this has been fixed.

Arrays could previously be initialized without subscripts.  this
syntax is invallid, and causes problems.  This will now result in
an error.


April 10, 1995

A rewind command was added which allows data to be read more than
once.

An allcaps command was added which is enalogous to pressing the
caps-lock key.  It converts all text inputted through the keyboard
to upper-case.


April 11, 1995

Due to a beta tester's request, the up-arrow character was
reintroduced as the exponential function.   this increased the size
of the run.bns program by about two K.

Gotos and gosubs are no longer stored as line numbers, they are
stored as file seek pointers.  therefore, gotos and gosubs do not
need to be searched for in the run.bns program.  this should speed
up basic program execution.

The documentation was greatly improved.  Instead of a commands.txt
file, we now have a basic.doc file, which not only contains a
command reference, but also contains information about creating and
running Basic programs.  It also contains a complete list of the
possible errors and their codes.


April 13, 1995

The mid$ function was misbehaving, and was not working properly as
a part of comparison statements.  It has been fixed.

The compile.bns program had a bug which caused commands which had
commas inside parentheses to be broken up.  Therefore, array
elements could not be used as a part of mid$ calls etc.  this has
been corrected.


April 16, 1995

The entire interpreter has been converted over to BCD math.  This
remidies the problems of mathematical errors which were due to the
use of thirty-two bit floating point numbers.  Expressions using
exponents may continue to yield incorrect answers, due to the fact
that the BCD routines only perform the four basic operations.  This
should also correct for next loop problems, and if statements.

Incorrect string reads now return an empty string (""), rather than
returning a syntax error.  for example, trying to access the fourth
character of a thre-character string would yield "" instead of a
syntax error.

Storing strings in arrays should be substantially faster, since
only one memory move is now performed.  the program used to delete
the old copy, and then insert the new copy of an element of a
string array.  It now makes room for the new copy with one memory
move, which should theoretically make storing values in character
string arrays twice as fast.


April 17, 1995

Due to a beta tester's request, the abs() function was added to
compute absolute value.

the internal storage of character string variables was converted
over to true strings.  This provides for much faster variable
access time.

A compile module for the PC was created.


April 24, 1995

The April 18 revision was problem-laden.  the major BCD conversion
had fairly well messed up the entire program.  Also I had forgotten
to convert one piece of the program when converting variable
storage of character strings to true string format.  Therefore,
that revision didn't work well at all.  This revision corrects all
of the problems found in the April 18 revision.  the PC-compiler
isn't working, and I will be looking into why.

The run.bns code size was reduced by about 1 K.

The question mark character is now supported as an alternative to
the print command.

The compile.bns program size was reduced by approximately five
hundred bytes.

White space is removed from the beginning and end of ifs and whiles
by this revision of the compile.bns program.


April 29, 1995

The structure of the run.bns program was changed to make the
implimentation of new commands easier.

the right$ and left$ functions weren't working, due to a minor bug.
this bug has been fixed.

The grade2 function name has been changed to grade2$.  this was
done in order to maintain consistancy.  Function names which end in
a $ character now all return string variables as results.


April 30, 1995

The sound command has now been added.  It expects two arguments. 
The first is the frequency of the sound, and the second is the
length of the note in .1 second incriments.


May 1, 1995

Four commands for controlling the BNS, TNS, and Braille Lite speech
synthesizer have been added.  They all expect one argument.  They
are setpitch, setrate, setvol, and setfreq.

Variables can now contain the period character.

There are two bugs that I am aware of in this revision.  One is
that the setpitch command doesn't work.  This is due to a problem
with the software in the BNS, TNS, or Braille Lite.  The other bug
is that if the speaker is turned off, the sound command does not
work, and furthermore, the speech chip is not reset to speech mode.

This results in the unit mumbling nonsense after exiting the
run.bns program.  Turning the machine off and on again will clear
up this problem.


May 2, 1995

The rename command was fixed.

The interpreter was not processing input strings containing
quotation marks correctly.  It now ignores quotes in strings.

The sound command was fixed.  It was not computing the correct
frequency for frequencies under 128 Hz.

The frequency parameter passed to the sound command is now range
checked.  It must be between 34 and 16000 Hz.

The volume of sounds played with the sound command is now relative
to the speech volume.

The PC compiler has been officially removed from this package.  We
will re-introduce it when all the bugs have been fixed, and a
finished version of the interpreter has been developed.



May 4, 1995

We have taken advantage of the latest revision of the BNS, TNS, and
BL software to fix the problem with the sound command.  The speech
system is now turned on, and the timer reset whenever the sound
command is invoked.

The compile.bns and run.bns programs now use binary searches to
find functions.  The compile.bns program uses this to determine
invallid variable names, and the run.bns program uses a binary
search of functions to speed up that search.

I have consolidated the substitute() and evaluate() function calls
throughout the run.bns program into a single sub_eval() call, which
saved about one K of program size.

The 0 frequency parameter to the sound command is now mentioned in
the documentation.  We also referr to the additional file called
music.txt, which provides information about programming music on
the BNS, TNS, or Braille Lite.


May 5, 1995

The sound command should now work properly.  Some code was
implimented to turn on the speech system before playing any sound. 
This code should work on the BNS and Braille Lite.  Users of these
machines will not need a new revision of the BNS or BL software. 
In order for the sound command to work properly on the TNS, users
will need the May 4 revision of the TNS software.

The Braille command previously spoke whatever text was passed to it
on the BNS and TNS.  It now does nothing on the BNS and TNS.

The beep command was added.

The power_on() function is no longer executed every time a sound
command is called.

The power_on() function now delays for a short time in order for
the power to come on.  (approximately 50 millisecs.)

Transitions between music and speech have been smoothed.  the
speech_mode() function which is used to bring the BNS, TNS, or BL
speech chip back into speech mode, now sets the correct pitch and
volume so that the transition is less noticeable.

The delay routine was recallibrated.

The sound routine was adjusted to compute frequency more
accurately.

The abort command which allows the haulting of both the compile.bns
and run.bns programs was added to the documentation.


When music_mode() is called, it now makes sure that the unit is not
talking before it switches the speech chip to music mode.

The question mark short form for the print command was added to the
documentation.


May 7, 1995

I added the chr$ function to the documentation.

The compile.bns program finally processes rem statements correctly.


May 8, 1995

The for next structure was writing bytes incorrectly to variables. 
this resulted in data being corrupted.  This has been fixed.

The sprint command returned the wrong error if it couldn't write to
the serial port.  It now returns "Can't write to serial port
error," code 26, which is correct.

All files are closed upon exiting the run.bns program.

The lf command was added.  this command turns on and off return
line-feed pairs generated by any of the output commands (print,
sprint, and fprint.)


May 9, 1995

I added some technical notes to the documentation, and provided
more examples for most of the commands.  All the commands that
accept multiple arguments or sets of arguments are now documented
as such.  Also, most commands will accept variables as arguments,
so examples are provided to that affect.

Well, I've finally come up with a remedy for the sound problem.  I
have added three commands for storing and using a sound buffer. 
they are setsound, splay, and sclear.  This is a 128 note sound
buffer, and the timing and execution are superb!

Several functions for getting the system time and date have been
added.  they are:

time.hour-- returns current hour (24-hour format)
time.min-- returns current minute
time.sec-- returns current second
date.month-- returns current month
date.day-- returns current day
date.year-- returns last two digits of current year


May 10, 1995

While playing with the commands I added last night, I found it
necessary to add another.  It is the setpos command.  It sets the
position in the sound buffer to start playing.  This way, a song or
sound can be played more than once.  the value must be between 1
and the number of notes in the buffer.

I added a function to check how many notes have been stored in the
sound buffer.  The function is num.notes.

There is now an overflow check on the sound buffer.

I added a pprint command to print text to the parallel port on the
Braille Lite and Type 'N Speak.  On the BNS, it says "Unit has no
parallel port error."

Retrieving speech parameters is now done through the following
functions:

pitch-- s.pitch
frequency-- s.freq
volume-- s.volume
rate-- s.rate

These functions replace the variables which were used.

I added a unit.type function which returns the number of the unit
being used, (0 for BNS, 1 for TNS, and 2 for Bl.)


May 11, 1995

Fixed a few problems in the compiler caused in the past couple
days.


May 12, 1995

I changed the status clicks routine in the compile.bns program to
use API_GET_TIMER rather than API_TIME_DATE.  API_TIME_DATE was too
slow in the TNS.  I also reduced status clicks to one every four
seconds.

I made .src the default extension for source files in the compile
program.  Therefore, instead of typing:

compile test.src

You can now type:

compile test


The run.bns program now handles multiple gosub arguments correctly,
i.e. gosub 100,200,300.

The setpos command was fixed.  It was not getting the correct
arguments, and would many times return an "argument out of range"
error or "syntax error."


May 14, 1995

I fixed the say and braille commands, which were not compiling or
running correctly.

I fixed a problem with the data statement.  It was executing more
than once if it was inside of a program.


May 15, 1995

The binary searches which located function names didn't catch the
last function, which happened to be val().  This caused the val()
function to return a syntax error in the run.bns program.  This
problem also made the statement:

val = 3

legal in the compile.bns program.  both problems were fixed.


May 18, 1995

The random number generator was fixed.


May 20, 1995

Any text written to a file is now written to the end of the file,
rather than overwriting the file.  Reading cursors are now stored
for each open file so that the program can read anywhere in the
file, and still write to the end of the file.

The val() function was modified to return 0 when processing non-
numeric strings, rather than a syntax error.


May 21, 1995

Dim statements were not being skipped on the initial scan for data
statements.  This has been fixed.

The inkey$ function was not respecting the allcaps setting.  This
has been fixed.


May 22, 1995

OProblems which I thought I had fixed are coming back to haunt me. 
This one was a result of the BCD conversions made over a month ago.

Perenthesees were not working correctly.  Hopefully, this is fixed.

Well, I think I finally have the random number generator working
OK.  Since the randomizer is dependent on the clock, the random
number generator would seed the generator with a 0 seed during the
midnight hour, or on the hour, or on the minute.  If any of the
hour, minute, or second variables were zero, the random number
generator would use a seed of zero.  This results in programs using
the same seed if you run the programs any time between 12:00 and
1:00 A.M.  Anyway, this has been fixed.


May 23, 1995

The compiler now runs much faster.


May 25, 1995

The sound commands now use the same volume as the regular speech.

The routine which puts the speech chip back into speech mode now
waits fifty milliseconds before returning.  This is to ensure that
the chip has had time to reset itself.

A problem with adding strings together was fixed.


May 30, 1995

Previously, when files were opened, and an error occurred, the
interpreter assumed the files to be open, even though they were not
actually open.  This problem has been fixed.
