MC-10 Operation and Language Reference Manual Appendix F






Appendix F/Micro Color BASIC
Language Reference Summary



Word
Purpose
Example
ABS Computes absolute value Y=ABS(5)
ASC Returns ASCII code of first
character of specified string
A=ASC(T$)
CHR$ Returns character for ASCII,
control, or graphics code.
P$=CHR$(T)
? CHR$(191)
CLEAR Reserves bytes of string storage
space. Initializes variables.
CLEAR
CLEAR 500
CLOAD Loads specified program file
from cassette. If filename is not
specified, first file encountered
is loaded. Filename must be
eight characters or less.
CLOAD
CLOAD "PROGRAM"
CLOAD* Loads numeric data into an
array from a cassette file which
has been created using the
CSAVE* statement.
CLOAD*A, DATAFILE
CLS Clears display to specified
color. If color is not specified,
green is used.
CLS
CLS(3)
CONT Continues program execution
after pressing [BREAK] or using
STOP statement.
CONT
COS Returns cosine of angle
measured in radians.
Y=COS(7)
CSAVE Saves program on cassette
(program name must be eight
characters/spaces or less.
CSAVE "PROGRAM"
CSAVE* Saves contents of a numeric
array on cassette for later use
by CLOAD*.
CSAVE*B,"MOREDATA"
DATA Stores data in your program.
Use READ to assign this data
to variables.
DATA 5,3,PEARS
DIM Dimensions one or more
arrays.
DIM R(85),W(40)
DIM AR$(8,25)
END Ends program. END
EXP Returns natural exponential of
number number (e number).
Y=EXP(7)
^ Exponentiation. Raises
number to specified power.
? 3^2
FOR...TO
STEP/NEXT
Creates a loop in program
which the Computer must
repeat from the first number to
the last number you specify.
Use STEP to specify how
much to increment the number
each time through the loop. If
you omit STEP, one is used.
FOR X=2 TO 5:
NEXT X
FOR A=1 TO 5
STEP 5: NEXT A
FOR M=10 TO 5
STEP -5
NEXT M
GOSUB Sends the Computer to subroutine
beginning at specified line
number.
GOSUB 500
GOTO Sends the Computer to
specified line number.
GOTO 300
IF/THEN Test the relationship. If it is
true, the Computer executes
the instruction following THEN.
IF A=5 THEN 30
INKEY$ Strobes the keyboard and
returns the key being pressed.
A$=INKEY$
INPUT Causes the Computer to stop
and await input from the
keyboard.
INPUT X$
INPUT "NAME";N$
INT Converts a number to an
integer.
X=INT(5.2)
LEFT$ Returns left portion of string. P$=LEFT$(M$,7)
LEN Returns the number of
characters in a string.
X=LEN(SEN$)
LET Assigns value to a variable. LET A$="JOB"
LIST List specified lines or entire
program on Screen.
LIST
LIST 50-85
LIST 30
LIST -30
LIST 30-
LLIST List specified program line(s)
or entire program to printer.
LLIST
LLIST 50-85
LLIST 30
LLIST -30
LLIST 30-
LOG Returns natural logarithm. Y=LOG(353)
LPRINT Prints an item or list of items
on the printer.
LPRINT, CAP$
MEM Returns amount of free
memory.
PRINT MEM
MID$ Returns a substring of another
string. If length option is
omitted, the entire string right
of position is returned.
? MID$(A$,3)
NEW Erases memory contents. NEW
ON...GOSUB Multi-way branch to specified
subroutines.
ON Y GOSUB
50,100
ON...GOTO Multi-way branch to specified
lines.
ON X GOTO
190,200
PEEK Returns the contents in the
memory location you specify.
A=PEEK(32076)
POKE Puts value into specified RAM
(memory). Value must be
between 0-255 and location
between 16384-20479.
POKE 16390,0
POINT Tests whether specified graphics
cell is on or off. The value
returned is -1 if the cell is in
the character mode, 0 if off, or
the color code if it is on.
IF POINT
(13,35)THEN
PRINT Prints specified message on
TV Screen.
PRINT "HI"
PRINT A$
? A$
PRINT TAB Moves cursor to specified
column.
PRINT TAB(5) "NAME"
PRINT@ Prints specified message at
specified Screen location.
PRINT @256, "HI"
PRINT @ 256, A$
READ Reads the next item in DATA
line and assigns it to specified
variable.
READ A$
READ C,B
REM Allows insertion of comment in
program line. Everything after
REM is ignored by the
Computer.
REM THIS IS
IGNORED
10 PRINT X:REM
THIS IS IGNORED
RESET Erases dot SET at specified
location.
RESET (14,15)
RESTORE Sets the Computer's pointer
back to first item on the DATA
lines.
RESTORE
RETURN Returns the Computer from
subroutine to the BASIC word
following GOSUB
RETURN
RIGHT$ Returns a right portion of
string
ZIP$=RIGHT$(AD$,5)
RND Returns a pseudo-random
integer between one and specified
number which must be
greater than one.
A=RND(10)
RUN Executes a program. RUN
SET Sets a dot at specified Screen
location to specified color.
SET(14,13,3)
SGN Returns sign of specified
numeric expression.
-1 if argument is negative
0 if argument is 0
+1 if argument is positive
X=SGN(A*B)
SKIPF Skips to end of next program
on cassette tape, or to end of
specified program.
SKIPF "PROGRAM"
SIN Returns sine of angle
measured in radians.
Y=SIN(5)
SOUND Sounds specified tone for
specified duration.
SOUND 128,3
STOP Stops execution of a program. STOP
STR$ Converts a number expression
to a string.
S$=STR(X)
SQR Returns the square root of a
number
Y=SQR(5+3)
TAN Returns tangent of angle
measured in radians.
Y=TAN(45.7)
VAL Converts a string to a number. A=VAL(B$)







Comments should be directed to the following email address:
dsbrain@neosplice.com