Building TinyBasic/VisualStudio

This is a brief explanation of what I did to build a VisualStudio-based
TinyBasic interpreter, assuming you are already familiar with the VS
build process.

The file 'Form1.h' started off as generated code -- VisualStudio, like
VisualBasic before it, does not take kindly to giving a meaningful name
to the window object. I've had a lot of trouble trying to integrate my
code and theirs, so this time I just pasted everything _inside_ their
form class. It involved a little more tweaking around the edges than was
necessary for Qt, but it essentially works the same.

As part of what I assume is their "managed" classes, they have some
strange new string type that I could not find any documentation on. So I
punted. I built a static character array that is kept up to date and
repeatedly sent to the text field for display. That way it never needs
disposing. So my ScreenChar() function is mapped to a putchar() method in
the #define macro; the putchar() method then updates the text array and
sends it to the ScreenText text field object for display. It works (even
faster than the approved message passing in Qt), but flickers badly. I
have no way of checking for memory leaks, but my code never allocates new
dynamic memory (after startup), so if there is any leakage, it's their
fault, not mine.

Input and output files I implemented with buttons instead of menus, and I
added a Stop button for the TinyBasic break test, which merely tests to
see if the button is depressed.

Passing input keystrokes from the GUI front end to the TinyBasic
execution thread I used the same "poor man's semaphore" consisting in two
numbers: one is incremented and set with the value of each new key code
by a KeyPress method, and the other is set to a copy of that value when
the character is accepted by the TinyBasic thread. Keystrokes will be
lost if the user gets ahead of TB, but that is inherently unpreventable.

Unlike the Qt example, I have not included all the project files for VS.
They have a zillion files of dubious function. It shouldn't be too hard
to build a new "solution" (whatever that is) and recreate the form, then
paste in my added code.

Tom Pittman
