Copyright 2008 Shoptalk Systems

RUN programName$[, #handle]

Description:

Run the program or project specified by programName$.  The calling program will block until the program that is run has reached a WAIT, INPUT, or UPLOAD statement, or until it terminates.

An optional #handle will allow the program to be treated as an object.  Functions that are defined in the program can be called as object methods.  The RENDER statement can also be used to embed the object in the page.

If the programName$ variable contains a string of the form of "projectName" then Run BASIC will look for the project with that name in the projects folder.  If the programName$ variable contains a string of the form "programName.bas" or "path\programName.bas" then Run BASIC will look for a .BAS file in the specified location.

Example:

[masterPage]
  cls
  html "<h2>Program manager</h2>"
  link #wiki, "Wiki", [runTheWiki]
  print " ";
  link #multi, "Multicounter", [runTheMulticounter]
  print
  if launchFlag then render #subProg
  wait

[runTheWiki]
  run "runWiki", #subProg
  launchFlag = 1
  goto [masterPage]

[runTheMulticounter]
  run "multicounter", #subProg
  launchFlag = 1
  goto [masterPage]