Monday, March 14, 2011

Power BASIC and the Uncrashable Kingdom

I had it in mind to use Power BASIC as the compiler to implement the new DOS file server for the factory. This was a new, slicker and rebranded version of Turbo BASIC which I had been using for a while. It wasn't cheap. Power BASIC was a nicely polished compiler and had good documentation. I think we paid $300 or so for it.

I wanted to create a nice UI for the file server so I purchased a windowing library for Power BASIC. It made it easy to create text mode windows using graphics characters. The way it worked was very similar to the way that a Windows programmer would do it in C. You called functions which created windows, buttons, etc. These would return a numeric handle.

Your program would intercept messages from the UI library in an event loop and act on them. Each message would include the handle for the window or widget it was about, and also a value for an action such as a click or a key press. This is not an easy way to write windowing code, but the file server would have a simple enough UI. The end result looked nice and was functional.

I learned a lot on this project. This must have been the highest quality BASIC code I had written to this point. It was a multitasking file server using state machine techniques. Unlike its Xenix based predecessor, this file server never crashed once we had it up and running. Never.

No comments: