
This directory contains "stbasic" version 1.0,
a Structured-BASIC-Interpreter

Written and maintained by: Wilfried Waetzig
                           University of Kassel
                           Germany
                           waetzig@hrz.uni-kassel.de

This program is distributed under the terms of the GNU License Agreement.
 
Structured-BASIC-Interpreter                          
- using the program-structure and data-structure from 
  "Chipmunk-Basic", an example program with p2c       
  by David Gillespie                                  
- using the graphic routines SRGP V1.0                
  a "Simple Raster Graphic Package"                   
  by  David Frederick Sklar                           
- using the functionality of GFA-BASIC on AtariST     
  with GEM/TOS (GFA-BASIC ported to UNIX-environment) 
          
FEATURES 
 
Structured-BASIC-Interpreter                     
- without line-numbers                           
- GOTO / GOSUB-labels are symbolic names         
- Structure elements:                            
    WHILE - EXITIF - WEND                        
    REPEAT - EXITIF - UNTIL                      
    DO - EXITIF - LOOP                           
    IF - ELSEIF - ELSE - ENDIF                   
    PROCEDURE - EXITIF - RETURN                  
    FOR - EXITIF - NEXT                          
- Variable types indicated by appendix to name:  
    varname     REAL (double)                    
    varname%    INTEGER (long)                   
    varname!    BOOLEAN (byte)                   
    varname$    STRING (char* )                  
- A PROCEDURE can have formal parameters and     
              local variables 
  for more details see: manual.txt.
              
PREREQUISITES 
 
- The p2c (PASCAL-to-C) converter must be installed.    
- SRGP "Simple Raster Graphics Package" must be installed. 
  For the directories of the include resp. library     
  files see the Makefile.                              

DIRECTORIES AND FILES

  examples/           contains several example-programs for stbasic
                        e.g. bessel.LIS, flaeche.LIS
  bin.linux/          contains the executable "stbasic"
                        compiled with p2c v1.20, gcc v2.7.2
                        for linux v2.0.25
  SRGP.linux/         contains libsrgp.a, srgp.h, srgp_phigs.h,
                        srgppublic.h for linux v2.0.25
  bas.p2crc           local include-file for "p2c"
                        defines special functions for "stbasic.p"
  Makefile            the makefile for stbasic
  README              this file 
  manual.txt          description of BASCIC-commands
  alertbox.c          source-file 
  filesel.c           source-file
  graphic.c           source-file
  menue.c             source-file 
  stbasic.c           output from p2c
  stbasic.p           PASCAL source-file
  syscalls.c          source-file

HISTORY

For my old computer AtariST I had written quite a lot of programs
in GFA-BASIC, a structured BASIC language.
When I switched to new hardware and a new operating system (linux),
I first intended to write a BASIC to C converter. But then I found
an excellent example for a BASIC-interpreter: "Chipmunk-BASIC" by
Dave Gillespie, which came as an example-program for "p2c".
Therefore I decided to port most of the functions of GFA-BASIC
under Atari-TOS/GEM to UNIX.

There are some missing functions and restrictions in the interpreter:
- no PEEK and POKE
- no BIOS and XBIOS-commands
  Some of the operating-system related commands can
  be called by SYSTEM-commands, e.g. SYSTEM "ls -al".

- There is a separation between an "alpha-screen" and a
  "graphic-screen", with Atari-TOS/GEM there exists only one screen.

- In the realization of the graphic functions I used the SRGP-package,
  which gave a relatively simple to use interface to the X-window
  environment, but has some limitations:

  - there exists only one active window the "graphic-screen",
    TOS/GEM can handle up to 4 windows,
  - the screen-size was set to AtariST dimensions: 640*400 pixels,
  - no HARDCOPY function,
  - the "graphic-screen" (256000 bytes) cannot be stored in a STRING
    or written into a file,

- Several built-in functions of TOS/GEM as ALERTBOX and FILESELECTOR
  were written in simple line-graphic, due to limitations in SRGP.

INSTALLATION

- Create a directory e.g. stbasic/
- untar the file stbasic1.0.tgz,
- check the Makefile, if p2c and SRGP is installed in the proper 
  locations,
- type "make", stbasic should compile without problems on linux,
  other platforms have not been tested now.

USING stbasic

  If the compilation was successful, type "stbasic",
  the interpreter will start in direct-mode, waiting for commands:
  direct>

  When using graphic-commands then the X11-environment is needed
  (fvwm must run). An extra "graphic-screen" is opened.
  This graphic-screen has the Atari-coordinates:
      the upper left corner is (0,0).
  Test the BASIC-programs in directory examples/  e.g.
    direct>load "examples/flaeche"
    direct>run
 
  More information about the implemented keywords and commands
  can be found in "manual.txt".

TODO
  
  correcting errors in this version,
  writing a man-page for stbasic,
  replacing SRGP by direct calls to xlib,
  include HARDCOPY to print a graphic-screen,
  make PROCEDURE for recursive calls.
  
