This is an old revision of the document!
X-BASIC Reference Manual
Statement and function name | Type |
Format:
It is the writing of commands and functions.
Items that are highlighted in red bold are data and arguments that are required.
Items enclosed in [] are optional.
… is repetition of similar. It represents input of data and arguments.
(Symbols such as (), {}, [] are reserved words) other characters must be entered exactly as shown.
As a general rule, please put space between the instruction and data name for command or statement. In addition, please do not put space between the left parenthesis enclosing the function name and arguments.
Abbreviation:
Argument:
Represents what type of argument a function needs as a general rule.
There are four data types. Functions that require more than one type of argument are summarized in parentheses according to each data type.
Anything valid is referred to as numeric type as long as it is a numeric type.
In addition, in special cases (in the case of array the dimension must also be stated) the argument variable must be stated as name or array (not constant, expression, etc. and arguments).
Returns:
The type of the written return value for all functions.
int, char, float, str have no return values (including the case where the return value does not exist).
Function:
→
Use cases:
Written expressions: | abs (n) |
Argument: | float |
Return value: | float |
Function: | Returns the absolute value of a number n. |
Use cases: | |
Written expressions: | apage (pa) |
Argument: | char |
Returns: | void |
Function: | Specifies the active page pa of the graphic screen (active page to read and write in the graphics screen). |
| Page number can be 0-3, the maximum value depends on the actual screen size and color mode of the graphics screen. |
| The range of values of the active page pa with actual screen size and color mode of the graphics screen: |
| 1024 × 1024 (16-color mode) ... 0
512 × 512 (16-color mode) ... 0-3
512 × 512 (256-color mode) ... 0,1
512 × 512 (65536-color mode) ... 0
|
→ | home , screen , Vpage , window |
Use cases: | |
Written expressions: | asc (st) |
Argument: | str |
Return value: | int |
Function: | Returns the character code of the first character of the string st. |
| st will return 0 if the character is null. |
| Refer to the “character code table” for the correspondence between characters and character codes. |
→ | CHR $ , “character code table” |
Use cases: | |
Written formula: | atan (n) |
Argument: | float |
Return value: | float |
Function: | Returns the inverse tangent of the numerical value n (arc tangent). |
| Returns the value from -π / 2 to π / 2. |
Use cases: | |
Written expressions: | atof (st) |
Argument: | str |
Return value: | float |
Function: | Converts the string st to float type number. st is a sequence of characters (+、-、0~9、.、e、E) that can be converted to a float type number. The conversion is not performed if there is a character for which the float value can not be determined. |
| The space or tab characters of st at the beginning will be ignored. In addition, there must be at least one or more digits before and after the decimal point. In addition, it must have at least one or more digits behind the e or E for exponential representation. |
| st can not be null character. |
| The following format of st string can not be converted. |
| [Whitespace] [sign] [.digits] [e or E [sign] digits] |
whitespace | Space or tab characters are ignored. |
sign | “+” or “-” |
digits | Decimall numbers which consist of 1 or more, and don't have anything in front of the decimal point, require at least one number behind the decimal point. |
Index | Index consists of “e” or “E” and decimal numbers with a sign. |