User Tools

Site Tools


x68000:x-basic

This is an old revision of the document!


X-BASIC Reference Manual

Statement and function nameType

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:

  • It is the writing of commands and functions that can be omitted. It should be noted that arguments, brackets, etc. can not be omitted.

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.
    • int, char, float (numeric type)
    • str (character 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:

  • Explains the meaning of arguments and the function of each instruction and function.

  • Related instructions and syntax references.

Use cases:

  • Simple sample programs and examples.

ABSStandard function
Written expressions:abs (n)
Argument:float
Return value:float
Function: Returns the absolute value of a number n.
Use cases:

APAGEGRAPH.FNC
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:

ASCStandard function
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:

ATANStandard function
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:

ATOFStandard function
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]
Example:st=“-2.51235e-2”
ECVT , fcvt , gcvt
whitespace Space or tab characters are ignored.
sign “+” or “-”
digits Decimal 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.
x68000/x-basic.1418108978.txt.gz · Last modified: 2019/08/27 20:44 (external edit)