Last revision: 12-feb-2005
a b c d e f g h i j k l m n o p q r s t u v w x y zSquare brackets represent that the part surrounded is optional.
Several elements separated by | means that you may choose one of the elements.
PRINT ABS (-1)
ALLOC_MEMORY ( n )
Allocates a block of memory of
size n and return his address. The block of memory is readable, writable
and executable if the operating system allows it. See the sample program
machinecode.bas for an example of use.
PRINT ... AT y, x ...
Place the
cursor in the x column of the line y. Contrary to the other cursor movement
instructions, the upper left of the screen is 0, 0.ATAN (y, x)
returns the arc between the x axis
and the line (0, 0) - (x,y).AUTO [initial number] [, increment]
Enter the auto
numbering mode. The default values are 10 and 10 but can be modified
via the system vars AutoInit and AutoInc or with the -a command line
option.BIN$ (number [,c] )
Returns a string of binary
digits with the value of number, if the c argument is present and the length
of the result is shorter than c is filled with zeroes.ON BREAK
.CHAIN filaname$ [ , line ]
Loads a program in memory and
begin execution from the beginning or from line. Variables are
not cleared.CHAIN MERGE filename$ [ , line ] [ , DELETE range ]
Merge
a program with the present in memory and begins executing the resulting
program from the beginning or from line. If the DELETE part is
present the range of lines is deleted before the merge, range can
be a single line or in the form initial-final where initial and final are
line numbers and can be omitted.CIRCLE (x, y), r, [ color ], [ initial ], [ final ] [ , e ]
Draws a circumference centered in (x, y) with radius r,
setting the graphics pen to color beginning in angle 0 or in
initial and ending in 2 * PI radians or in final. If e
is present an ellipse is drawed instead, if e is greater than 1 the
x axis is divided by e, else the y axis is multiplied by it.CLEAR
Clear all variables and arrays, close all opened
files, erase user defined functions, set trigonometric mode to radians,
forget pending loops.CLEAR INK
Restore all inks to its default values.CLEAR INPUT
Discards all key and mouse button events
actually buffered.CLS
Clear the screen.CLS [ #window ]
Clear the text window
specified (0 by default).COPYCHR$ (#w)
return the character present at
the current cursor position in window w, or the empty string if the
character can't be recognized.DEC$ ( number, format)
Returns a string
representing the number using the specified format, that
is a format specifier like the used in PRINT USING limited to numeric
formats that represent a single number.DEF DBL | INT | REAL | SNG | STR letter-specifier.
Define that the variables beginning by a letter specified in the
letter-specifier are of type: DBL, REAL, SNG ---> floating
point, INT ---> integer, STR ---> string. The various types of
floating point are admitted for compatibility with other Basics.DEF FN
Not documented yet.ERROR n
Forces the error number n, stopping the program or jumping
to the position established by an ON ERROR GOTO instruction. For a list of the error
numbers used by blassic refer to the error.h file in the sources.EXIT [n]
Quit blassic returning to the operating system.
The n value, 0 if not specified, is used as the return value of the blassic
command (the ERRORLEVEL value in Windows).FILES
List files in current directory.FILES [ #channel , ] "mask"
List files in current directory
that matches mask. The wildcards allowed are operating system dependant.
The listing is directed to the channel specified, 0 by default, that can
be a window or a file.FIND_FIRST_OF (searched$, char$)
Returns the
first position of searched that contains a character of char$, or 0 if
none is found.FINDFIRST$ (mask$)
Returns the first file that
matches wiht mask$ or the empty string if there is no match . The wildcards
allowed and his interpertation are operating system dependant.GOSUB line_specification
Calls the subroutine located at
line_specification, that can be a line number or a valid LABEL. The control
will return to the actual point when a RETURN is executed. See also ON
GOSUB.GOTO line_specification
Transfer the control to the position
line_specification, tnat can be a line number or a valid LABEL. See also
ON GOTO.HEX$ (number [ , width] )
Returns the hexadecimal
representation of number as string. If width is specified and is too
great the result will be filed with leading zeros, if is too small
the result is NOT shortened.IF_DEBUG n
If debug level is greater or equal than n the
rest of the line is executed, otherwise is ignored.INK n
Same as PEN n
INK n, color [, second]
Define the ink number n as the
color, from the tabla of Amstrad CPC compatible colors. The optional
second parameter is accepted for compatibility with the CPC but is
ignored.INK n, r, g, b
Define the ink number n as the color from
the rgb componentes, r, g and b between 0 and 255.INK n
Same as standalone instruction, but
the efects remains only until the actual PRINT ends.INSTR ( [start_pos , ] searched_string$,
string_to_find$)
Returns the position of the first
occurrence of sting_to_find$ in searched_string$, or 0 if
not present.The position at wich to start can be specified
as start_pos.LABEL identifier
Define a label in the program, then
instructions that normally uses a line number as parameter, such as
GOTO, can use the indetifier instead. LABEL must be the first instruction
in a line, otherwise is ignored.LEFT$ (string$, n)
Returns the first n charaters
from string$, or string$ if n is greater than LEN(string$).LEN (string$)
return the length of the string.LOAD "program"
Load a blassic program. If program is
not found program.blc and program.bas are tried.LOAD "filename", var$
Load a file into a string var.LOAD "filename", address [, size]
Load a file in the address
of memory specified. If size is given loads only that size, otherwise the
entire file.
LOCATE [ #channel , ] a, b
Move the cursor to the position
specified with the coordinates a, b. The screen origin is 1, 1. Channel must
be a graphics window in graphics mode or the console output in text mode, if
omitted channel 0 is used. The order of the coordinates is dependant of the
system variable Flags1, by default Microsoft style (row, col) is used.MAX (list of numeric expresssions)
Returns the
maximum of the list.MID$ (string$, pos [ , length ] )
Returns the
substring of string$ that begins at pos and has length characters or to
the end of string$ if length is not specified or is too long.MID$ (string$, pos [, length] )= stringexpr$
Replaces the substring of string$ specified as in MID$ function with
stringexpr$.MIN (list of numeric expressions)
Returns the
minimum value of the list.a MOD b
returns the remainder of a / b.NAME file1$ AS file2$
Renames the file named file1$ as
file2$.OCT$ (number [ , width ] )
Returns the octal
representation of number as string. If width is specified and is too great
the result will be filled with leading zeros, if is too samll the result
is NOT shortened.ON BREAK CONT
Cancel the effect of ctrl-c of stopping the
program.ON BREAK GOSUB n
When ctrl-c is pressed the program whill jump
to the subroutine specified. n can be a line number or a label.ON BREAK STOP
Disables the effect of ON BREAK CONT and ON BREAK
GOSUB, ctrl-c will interrupt the program.ON ERROR GOTO n
Jumps to the specified line when an error
is detected in the program. n can be a line number or a label. See RESUME,
ERR, ERL.POS (#channel)
return the horizontal position
of the cursos in that channel. Only screen channels are allowed.
PROGRAMARG$ (n)
returns the n command line
parameter with blassic is calles, excluded the blassic command and the
program name, or the empty string if there is no sufficient parameters.PROGRAMARG$ arg1$ [, args$ ....]
Establishes the
return values of the PROGRAMARG$ function to the args specified. Useful when
debugging.REGEXP_INSTR ( [ pos , ] searched$, regexp$ [ , flags] )
Returns the position of the first match of the regexp$ regular expression
in searched$, or 0 if no match. If pos is specified the regexp matching
begins at that position. For the values of the flag parameter see
REGEXP_REPLACE$.
REGEXP_REPLACE$ ( [ pos, ] searched$, regexp$, rep [, flags] )
Returns the string searched$ with the matches of the regular expression
regexp$ replaced by the rep parameter, that can be a string or a FN. In the
former case, the $n contained in the string are replaced by the
subexpressions matched, in the later the FN function is called with the
subexpressions as arguments. The bits on the flag affect the result in
the follwing mode: bit 0 sets nocase mode, bit 1 set nobegin mode (the
string is treated as no located as the begin in a line), bit 2 set noend
mode (the string is treated as no located at the end of a line), bit 3
sets the newline mode (the 'any charater' wildcards not match a newline
character) and the other bits are reserved for future use, must be 0.
If pos is specified the regexp matching begins at that position.
RESUME [NEXT | n]
On an ON ERROR GOTO routine, returns to
the statement that produced the error, to the next statement, or to the
postion specified by n, that can be a number line or a label.RIGHT$ (string$, n)
Returns the last n charaters
from string$, or string$ if n is greater than LEN(string$).SAVE "program"
Saves the program in Blassic binary format.
The recommended extension is .blc, but is not added automatically.SAVE "program", A
Saves the program in text format.
The recommended extension is .bas but is not added automatically.SAVE "filename", B, var$
Save the content of the string var$
into filename.SAVE "filename", B, address, length
Save length bytes of memory
beginning at address.
SCROLL [#window ,] [n]
Scroll the graphics window specified
by window, 0 by default, the number of lines specified by n, 1 by default.
If n is positive scrolls up and place the cursor at the beginning of the
last line, if negative scrolls down and place the cursor at the beginning
of the screen.
SHELL command$
Executes command$ as a shell command.SOCKET "host", port AS #channel
Open a socket and connect it
to the host specified using the tcp port number, and associates it to the
input/output channel.SYMBOL n, b1, b2, b3, b4, b5, b6, b7, b8
Define the char number n with 8 bytes of data, each bit corresponding to
one pixel. b1 to b8 can be omitted, 0 is applied in that case.SYMBOL AFTER n
Set the number of permissible user defined
characters. Characteres with values from n to 255 become definables. With 0
all chars are definables, with 256 none. All characters are reset to their
default values.SYSTEM
Quits blassic returning to the operating system.TAB n
Prints spaces until the horizontal
postition of printing reaches n. If n is greater than the current position,
before doing this spaces are printed until reached the end of the line if
the current channel is a grpahic window, then a line end is emitted..TEST (x, y)
moves the graphic cursor to x, y
and returns the ink number corresponding to the color of that point.TRON [ LINE ] [ #channel ]
[line-number]
(The [ ] are literal in this case); with LINE
specified the entire line is printed. The information is printed in the
channel specified, 0 if omitted.VPOS (#chanel)
return the vertical position
of the cursor in channel. Only screen channels in graphics mode are
allowed.WIDTH LPRINT n [, m]
Stablishes the width of the printer
output, when the width is exceeded a line separator is emitted (see
the PrinterLine system variable. A value of 0 means unlimitted
width. The value m if specified set the left margin for the printer in
chars.ZONE value
Stablishes value as the width of the
zones used by the , PRINT delimiter. A value of 0 means 8 in the
graphics window and that a tab character is used instead of spaces in
printer and in text mode.That's all folks!
Site design and artwork by Sevein .
Hosting courtesy of Tecnawebs.com