Page 246 - The Unofficial Guide to Lego Mindstorms Robots
P. 246

235


          B
          A pbForth Downloader

          pbFORTH is  a interesting,  funky  programming environment, but there are  not many tools available for it.  This appendix
          contains source code  for a program downloader, written in Java.  A program downloader enables you to  develop your
          pbFORTH programs in a text editor and download them all at once to the RCX. This means you have a saved copy of your
          program that is easy to browse and modify.

          The program downloader presented here is a "smart" one; it analyzes the responses from pbFORTH to see if any errors occur
          as the download is progressing. If pbFORTH complains about something, the downloader tells you about it.

          System Requirements

          To compile and run this program, you'll need the Java Development Kit (JDK)  version 1.1  or later (see
          http://java.sun.com/products/jdk/1.2/  for the latest version). You'll also need the Communications API, a standard extension
          API that enables Java programs to use the serial and parallel ports of a computer (see http://java.sun.com/products/javacomm/).

          Usage

          The program downloader is called Download. It's very simple to use—you just need to supply the name of the Forth source
          code file. For example, you can download a file like this:

            c:\>java Download thermometer.f
            ............................
            c:\>
   241   242   243   244   245   246   247   248   249   250   251