




















                    *************************************
                    *                                   *
                    * MBASIC version 1.01               *
                    * Copyright (C) 1992 by Andre Murta *
                    *                                   *
                    *************************************


























I N T R O D U C T I O N     T O     B A S E D


**********************
* Calling the editor *
**********************

Included in the MBASIC package,  there is a file editor the programmer can use
to edit  and  run  MBASIC programs.  The editor can be used to edit one MBASIC
file per session,  but  the  user  can  split the main window in two, and swap
between the two opened files.
The syntax to call the editor is:

A:>based -+line[def = 1] -ttab[def = 2] file[def = Notes]

For example:

A:>based -+8 -t4 cube.bas

In the example above,  the user  is calling the editor to open the file called
"cube.bas",  the  default  editing  line will be automatically 8 and tabs will
have 4 spaces in size.

The result screen under DOS would be:


cube.bas     .......  F1-Help
REM ***********************************
REM *                                 *
REM * The MBasic 32 bit BASIC system  *
REM * First example program           *
REM *                                 *
REM ***********************************
REM
CLS
COLOR 2,8
PRINT "Hello world!   :)" : PRINT " "
COLOR 7,1
PRINT "This program will calculate the cube"
PRINT "of a user entered number."
PRINT "------------------------------------"
INPUT "Enter a number: ",number
PRINT "The cube is: ";number^3


The cursor would be positioned under the CLS command in the line #8.


******************
* Editing a file *
******************
In the editor environment, the user has many functions that could be used to
execute text processing and call for DOS services.

Below there is a list with all available commands in BASED:

CTRL + [Aa]: Set block mark
CTRL + [Bb]: Format text (not very good to program code)
CTRL + [Cc]: DOS Shell, swap to OS environment until user type 'exit <ENTER>'
CTRL + [Dd]: Cursor right (can also be the right arrow)
CTRL + [Ee]: Cursor up (can also be the up arrow)
CTRL + [Ff]: Forward text search
CTRL + [Gg]: Goto line
CTRL + [Hh]: Delete current char
CTRL + [Ii]: Tab
CTRL + [Jj]: Play macro
CTRL + [Kk]: Copy block
CTRL + [Ll]: Refresh screen
CTRL + [Mm]: Carriage return
CTRL + [Nn]: Toggle insert/overwrite mode
CTRL + [Oo]: Toggle mode
CTRL + [Pp]: Command prefix
CTRL + [Qq]: Command prefix
CTRL + [Rr]: Replace text
CTRL + [Ss]: Cursor left (can also be the left arrow key)
CTRL + [Tt]: Delete word over cursor
CTRL + [Uu]: Block paste
CTRL + [Vv]: Page down (can also be the PgDn key)
CTRL + [Ww]: Second window
CTRL + [Xx]: Cursor down (can also be the down arrow key)
CTRL + [Yy]: Delete line
CTRL + [Zz]: Exit (ask for file save)

The command key are *NOT* case sensitive, pressing CTRL+A is the same if press
press CTRL+a. Using the command CTRL + [Pp], the user can access the auxiliary
function of each key.  The chars between the [] are the possible useful chars,
for example: CTRL+[Pp] means CTRL+P or CTRL+p (it's the same).
Below there is the auxiliary command list:

CTRL + [Pp] + [Aa]: <<<NONE>>>
CTRL + [Pp] + [Bb]: Set right margin
CTRL + [Pp] + [Cc]: Execute current line in the OS
CTRL + [Pp] + [Dd]: Goto end of line
CTRL + [Pp] + [Ee]: Goto top of file
CTRL + [Pp] + [Ff]: Backward text search
CTRL + [Pp] + [Gg]: Goto column
CTRL + [Pp] + [Hh]: Delete before current char
CTRL + [Pp] + [Ii]: Tab insert
CTRL + [Pp] + [Jj]: Record macro sequence
CTRL + [Pp] + [Kk]: Block cut
CTRL + [Pp] + [Ll]: Show status
CTRL + [Pp] + [Mm]: <<<NONE>>>
CTRL + [Pp] + [Nn]: Run program in MBASIC
CTRL + [Pp] + [Oo]: <<<NONE>>>
CTRL + [Pp] + [Pp]: <<<NONE>>>
CTRL + [Pp] + [Qq]: <<<NONE>>>
CTRL + [Pp] + [Rr]: Replace all
CTRL + [Pp] + [Ss]: Goto to begin of line
CTRL + [Pp] + [Tt]: Delete to the end of line
CTRL + [Pp] + [Uu]: Block write
CTRL + [Pp] + [Vv]: Page up
CTRL + [Pp] + [Ww]: Cancel window
CTRL + [Pp] + [Xx]: Goto the end of file
CTRL + [Pp] + [Yy]: <<<NONE>>>
CTRL + [Pp] + [Zz]: Edit another file


The block  commands are directly related to the mark definitions. For example:
supposing the  user would like to copy a block of text to memory,  first it is
necessary to mark the block begin using the command CTRL+[Aa],  to do it, it's
just necessary to put the cursor immediatelly at the character that is located
in the beginning of the block area. After it, move the cursor to the character
at  the  end of  the desirable  block area and press CTRL+K  to copy it to the
buffer.
Taking the file "cube.bas" as example:

cube.bas     .......  F1-Help
REM ***********************************
REM *                                 *
REM * The MBasic 32 bit BASIC system  *
REM * First example program           *
REM *                                 *
REM ***********************************
REM
CLS
COLOR 2,8
PRINT "Hello world!   :)" : PRINT " "
COLOR 7,1
PRINT "This program will calculate the cube"
PRINT "of a user entered number."
PRINT "------------------------------------"
INPUT "Enter a number: ",number
PRINT "The cube is: ";number^3


Supposing it is necessary to copy the comment area to the end of the file (??)
it is just a matter to put the cursor at the 'R' of the first line of the text
and press CTRL+[Aa].

cube.bas     .......  F1-Help
[R]EM ***********************************
REM *                                 *
REM * The MBasic 32 bit BASIC system  *
REM * First example program           *
REM *                                 *
REM ***********************************
REM
CLS
COLOR 2,8
PRINT "Hello world!   :)" : PRINT " "
COLOR 7,1
PRINT "This program will calculate the cube"
PRINT "of a user entered number."
PRINT "------------------------------------"
INPUT "Enter a number: ",number
PRINT "The cube is: ";number^3


After, it is necessary to move the cursor to the end of the block area, in
this case, the beginning of the line #7

cube.bas     .......  F1-Help
REM ***********************************
REM *                                 *
REM * The MBasic 32 bit BASIC system  *
REM * First example program           *
REM *                                 *
REM ***********************************
[R]EM
CLS
COLOR 2,8
PRINT "Hello world!   :)" : PRINT " "
COLOR 7,1
PRINT "This program will calculate the cube"
PRINT "of a user entered number."
PRINT "------------------------------------"
INPUT "Enter a number: ",number
PRINT "The cube is: ";number^3


Press CTRL+[Kk]  and the block will be copied to the memory.  After that, move
the cursor to the end of the file and press CTRL+[Uu]. The copied block should
appear copied at the end of the file.

cube.bas     .......  F1-Help
REM ***********************************
REM *                                 *
REM * The MBasic 32 bit BASIC system  *
REM * First example program           *
REM *                                 *
REM ***********************************
REM
CLS
COLOR 2,8
PRINT "Hello world!   :)" : PRINT " "
COLOR 7,1
PRINT "This program will calculate the cube"
PRINT "of a user entered number."
PRINT "------------------------------------"
INPUT "Enter a number: ",number
PRINT "The cube is: ";number^3
REM ***********************************
REM *                                 *
REM * The MBasic 32 bit BASIC system  *
REM * First example program           *
REM *                                 *
REM ***********************************


All  the editor  commands will work in a similar way. After this basic notions
the user is able to start  the editor to  create new programs or edit programs
already  present in  the disk.  The user is invited to try the commands listed
here  (being  careful  to  avoid  to  save  any  significant change that could
invalidate the edited code).

