ScriptBasic is a neat open-source Basic for Windows and Linux written by Peter Verhás. A ScriptBasic-capable web server (which can run either stand-alone or as a module to Apache) is also available so you can build web pages that contain ScriptBasic code.



  1. Create a directory eg. c:\scriptb, and extract into it
  2. Documentation recommends that you add c:\scriptb\bin to the PATH environment variable
  3. Edit c:\scriptb\scriba.conf.lsp to fit your system. See below for a sample
  4. Cd to c:\scriptb\bin\, and recompile the configuration file : scriba -k ..\scriba.conf.lsp . This generates the binary file c:\scriptb\bin\scriba.conf.

    Note that when ScriptBasic starts, it looks for this file in the same directory where scriba.exe lives. If you prefer to move this configuration file elsewhere, open the Registry, and set HKEY_LOCAL_MACHINE\Software\ScriptBasic\config to hold the path to the (binary) configuration file

ScriptBasic is now installed on your Windows host. You can run SB scripts either from the command line, or as web pages.

Command-line interpreter

Here's the usual "Hello World!" example:

  1. Create a source file called hello.bas with the following code:

    Print "HELLO WORLD"
  2. Run the script: scriba hello.bas

To speed things up, you can compile a source file into tokenized code:

  1. scriba -no hello.bbf hello.bas
  2. scriba -b hello.bas

(CHECK) You can also associate the extension <.sb> (???) with the ScriptBasic interpreter. In this case you can start a ScriptBasic program double clicking on its name in the explorer.

Web server

Now that you have recompiled scriba.conf to fit your host, especially the httpd section, open a DOS box, and run "C:\scriptb\bin>sbhttpd -start" to start ScriptBasic's web server. Run "netstat -an" to check that a program is listening on TCP 80.

Note: To install the Eszter SB Application Engine as NT Service open a command prompt, cd into the directory where the file sbhttpd.exe is located and type sbhttpd -install.

Assuming that the "home" parameter in the httpd section above is set to "C:\\scriptb\\examples\\", create C:\scriptb\examples\index.html to contain the following code:

#! C:\scriptb\bin\scriba.exe -c
include cgi.bas
cgi::Header 200,"text/html"
print """
print cgi::GetParam("apple")

Aim your browser at http://localhost:8080/index.html?apple=wozniak


Sample configuration file

Here's an example configuration file from a Windows NT installation:

; scriba.conf
; ScriptBasic sample configuration file
; Note that this configuration file format is from v1.0b19 or later and has to be compiled
; to internal binary format before starting ScriptBasic
; this is the extension of the dynamic load libraries on this system
dll ".dll"
; where the modules are to be loaded from
module "C:\\scriptb\\modules\\"
; where to search system and module include files
; trailing / or \\ is needed
include "C:\\scriptb\\include\\"
; define external preprocessors
preproc (
  internal (
    ;test "T:\\MyProjects\\ScriptBasic\\Debug\\preproc.dll"
    dbg "T:\\MyProjects\\ScriptBasic\\modules\\dbg.dll"
; extensions that preprocessors are to be applied on
  extensions (
; here the key is the file name extension and the value is the symbolic name of the external preprocessor
; for example
;    lsp "lisp"
; would say that all input that has the file name extension '.lsp' should be preprocessed using the external
; preprocessor named 'lisp'. The commad line to start this preprocessor has to be defined a few lines below
; saying:
;   lisp (
;     executable "command line"
;      directory "directory for the temporary files after preprocessing"
;    )
; Note that this is only an example, there is no 'lisp' preprocessor for ScriptBasic or at least I do not know any.
     heb "heb"
; the external preprocessors
  external (
    heb (
      executable "C:\\scriptb\\bin\\scriba.exe t:\\MyProjects\\ScriptBasic\\source\\heber.bas"
      directory "t:\\MyProjects\\ScriptBasic\\hebtemp\\"
; the maximal number of steps allowed for a program to run
; comment it out or set to zero to have no limit
maxstep 0
; the maximal number of steps allowed for a program to run
; inside a function.
; comment it out or set to zero to have no limit
maxlocalstep 0
; the maximal number of recursive function call deepness
; essentially this is the "stack" size
maxlevel 300
; the maximal memory in bytes that a basic program is allowed to use
; for its variables
maxmem 1000000
; ScriptBasic loads the modules before starting the code
; in the order they are specified here
;preload "ext_trial"
; This is the directory where we store the compiled code
; to automatically avoid recompilation
cache "C:\\scriptb\\cache\\"
isapi (
; where to write error messages when running the isapi interpreter
  report "C:\\scriptb\\httpdlog\\error.log"
; When an error happens this file is sent to the client after the
; listed error messages. Error messages are recorded in the error log file
; if there is configured any and are also sent to the client browser.
; after the list of error messages this file is sent. This is actually the tail
; of an HTML file. It has to contain </TT></FONT></BODY></HTML> tags in this
; order with optional extra text between. You probably want to place the webmaster
; eMail address in this text.
  errmesfile "C:\\scriptb\\examples\\error.html"
; If this config key exists scribais.dll will cache the compiled code
; into memory. To avoid memory caching during development comment this
; config line out.
; Note that if there is a code in memory cache it is used even if the code on
; disk has changed! This results fast execution but may be inconvinient during
; development.
;memcache yes
; This parameter is used by the CGI module when the interface is ISAPI
; This parameter gives the size of the buffer that the module uses to handle
; POST parameters above 48K (usually uploads). The larger the buffer is the
; faster upload handling can be.
  buffer "655360"
cgi (
; These are the keys used by the CGI module
  debugfile "C:\\scriptb\\httpdlog\\cgidebug.txt"
; berkeley db config
;bdb (
 ; directories where to store the
; dir (
;   home "C:\\scriptb\\httpdlog\\sampledb" ; the home directory of operation of the Berkerley DB
;   data "db"  ; database files
;   log  "log" ; log files
;   temp "tmp" ; temporary files
;   )
; ScriptBasic extension modules can access only string configuration values
; therefore you have to specify these numbers within quotes (later versions will change it)
;  limits (
;    lg_max "1024000"
;    mp_mmapsize "0000"
;    mp_size "000"
;    tx_max "000"
;    lk_max "000"
;    )
  ; what lock strategy to use
  ; it can be any of the followings
  ; default oldest random youngest
;  lockstrategy default
;  flags (
;    ; set the value to yes or no
;    lock_default no
;    init_lock yes
;    init_log yes
;    init_mpool yes
;    init_txn yes
;    create yes
;    )
;  )
; MySQL configuration
mysql (
  connections (
    test (        ; the name of the connection
          host "" ; the host for the connection
          db "test"   ; database for the connection
          user "root" ; user for the connection
          password "" ; password for the connection
          port 0      ; the port to use
          socket ""  ; the name of the socket or ""
          flag 0      ; the client flag
          clients 10  ; how many clients to serve before really closing the connections
    auth  (
          host "" ; the host for the connection
          db "auth"   ; database for the connection
          user "root" ; user for the connection
          password "" ; password for the connection
          port 0      ; the port to use
          socket ""   ; the name of the socket or ""
          flag 0      ; the client flag
          clients 10  ; how many clients to serve before really closing the connections
odbc (
  connections (
    test (        ; the name of the connection
          dsn "test" ; data source name
          user "" ; user for the connection, to test we use MS-Access thus there is no user or passwd
          password "" ; password for the connection
; This type of internal preprocessor was experimental and is not supported by ScriptBasic
; since build v1.0b26
; Configure the sample preprocessor
; preproc$sample_uppercase "D:/MyProjects/sb/Debug/preproc.dll"
; Configure the simple ScriptBasic httpd daemon
; Note that scripts may change the working directory therefore
; all directories should be specified here full path. For example
; the directory names here do not include the drive c: or e:
; because I develop it on two machines and it was inconvenient
; to alter and recompile the config file each time I moved the
; source to the other machine. When I run a script that changes
; the drive the http daemon stops in a few seconds because the
; guard thread do not find the pid file and therefore tells the
; engine to stop.
httpd (
  threads 20
  listenbacklog 30
  port 8080
  home "C:\\scriptb\\examples\\"
  proxyip 0 ; set it true if you use Eszter engine behind Apache rewrite and proxy modules
  pid (
    file "C:\\scriptb\\httpdlog\\pid.txt"
    delay 10 ; number of seconds to sleep between the examination of the pid file if that still exists
    wait (
      period 10 ; number of times to wait for the threads to stop before forcefully exiting
      length 1  ; number of seconds to wait for the threads to stop (total wait= period*length)
;  vdirs (
;    dir "/user/:C:\\scriptb\\examples\\user\\"
;    dir "/cgi-bin/:C:\\scriptb\\examples\\cgi-bin\\"
;    dir "/sibawa/:C:\\scriptb\\examples\\sibawa\\cgi-bin\\"
;    )
  client (
    allowed ""
    allowed ""
;    denied ""
;    denied ""
;  run (
;    start   "C:\\scriptb\\examples\\runstart.bas" ; start the program in an asynchronous thread
;    start "C:\\scriptb\\examples\\sibawa\\sibawastart.bas"
;    restart "t:\\MyProjects\\ScriptBasic\\source\\examples\\runrestart.bas" ; same as start, but when the program terminates start it again
;    )
  errmsgdest 3
  nolog 0 ; set this true not to use logs or ignore erroneouslog configuration
  log (
    panic ( file "C:\\scriptb\\httpdlog\\panic.log" )
    app   ( file "C:\\scriptb\\httpdlog\\app.log" )
    err   ( file "C:\\scriptb\\httpdlog\\err.log" )
    hit   ( file "C:\\scriptb\\httpdlog\\hit.log" )
    stat  ( file "C:\\scriptb\\httpdlog\\stat.log" )
  ; the error page when a page is not found
msg404 """
<TITLE>Error 404 page not found</TITLE>
<FONT FACE="Verdana" SIZE="2">
<H1>Page not found</H1>
We regretfully inform you that the page you have requested can not be found on this server.
In case you are sure that this is a server configuration error, please contact
<FONT SIZE="3"><TT>root@localhost</TT></FONT>
  code404 "200 OK" ; the http error code for page not found. The default is 404
  ; the program to run when a page is not found
  ;run404 "t:\\MyProjects\\ScriptBasic\\source\\examples\\run404.bas"
  mt (
    sleep 55



Web scripts

To run a ScriptBasic through CGI, set the web server to launch scriba.exe when a .bas page is requested.

There are two ways to write CGI programs in ScriptBasic. The old way is just like in any other language: the basic program can access the environment, the standard input and standard output. This is all needed to write a CGI program, decode the CGI parameters and create the http response.

The better way is to use the CGI module delivered with ScriptBasic that automatically handles CGI input, CGI environment variables, creates the uploaded files and even supports some security settings. For more details on the CGI module read the separate documentation of the module named CGI.

You can also execute BASIC programs in the Eszter SB Application Engine to generate web applications. In this case the Eszter SB Application Engine has to be started from the command line or as a daemon under UNIX or installed as a service under Windows NT. The BASIC programs are executed inside the engine without starting a new process unlike in CGI and thus execution is faster. Nevertheless the programs on the BASIC programming level feel as if they were CGI programs, thus CGI programs can be executed this way without any modification.



I unzipped "" but the documentation says "To install the software on Windows is quite easy. Extract the ZIP file into a temporary directory and start the executable `SETUP.EXE'." No trace of this program.

From Peter Verhas: "On the download page there are several files. The contains the Win32 binaries and documentation. The other file contains the setup code. You need the first if you want to install ScriptBasic by hand and the second if you want to install ScriptBasic using the setup.exe program."

SBHTTPd dies

No web server is running on either TCP 80 or 8080. Panic.txt : "Can not initialize the configuration management system." Even running the server with "sbhttpd -start" results in the same error.

=> Edit and recompile scriba.conf.lsp to fit your setup (eg. paths, etc.)

Cannot open panic log

C:\scriptbasic\bin>sbhttpd.exe -start

Can not open panic log.

=> Edit and recompile scriba.conf.lsp to fit your setup (eg. paths, etc.)


I was recompiling the configuration file with C:\scriptbasic\bin>scriba -k ..\scriba.conf.lsp. Until then, it would create C:\scriptbasic\bin\scriba.conf, but after removing this file, it created scriba.ini in C:\WINNT instead.

=> Create an empty C:\scriptbasic\bin\scriba.conf and re-run the compilation.