FromCLI  -  Basic from the Command Line

by Kostas Proitsakis

FromCLI is a module that enables you to issue Basic commands and statements, and run Basic programs, from the command line or from within Obey files. This opens up a huge range of possibilities that are normally beyond the scope of RISC OS. For example, you could issue SYS calls, or get keyboard input, from Obey files, perform floating point calculations at the command line, and much more.

Running the item from the RISC User menu system, or double-clicking on its icon in a Filer window, installs the FromCLI module and opens the Files directory (see below). If you are likely to make a lot of use of it, you will find it preferable to install the module at start-up by including the appropriate line in your desktop boot file (the module itself is located inside the !FromCLI application directory).

Once installed, the module implements five single-character commands:
  #
  {
  }
  [
  ]

These behave as follows:

# clears the module's workspace in order to start
a new Basic program from the CLI. It must be used
once after installing the module in order to get
the address of the Basic tokenise routine. It
takes no parameters.

The remaining commands are all followed by a space
and then a Basic keyword or line of Basic code.

{ adds a line to the program built in memory.

} adds the last line to the program and calls
Basic to execute it.

[ and ] are the same as { and } but take Basic
tokenised statements in the parameter string. This
can be used to pseudo-hide the listing of the
Basic program in Obey files.

Program examples
The Files directory within the !FromCLI application directory contains an example Obey file program called Hearts which displays heart-shapes graphics on the screen, and another called Convertor which will convert a Basic program into a suitable Obey file. Further information is given in the article in this month's RISC User entitled Basic from the CLI, as well as a complete listing of the module's source code.

Copyright  RISC User 1995

Author  	Kostas Proitsakis
		Eleftherias 37
		553 37 Thessaloniki
		Greece
