A string which is 255 digits or less including alphanumeric, Kana, symbol, and Kanji, enclosed in
double quotation marks (”). If a double quotation mark (”) is used in the character string, the CHR$
function should be used.
Numeric constants:
Integer type: Decimal format:-32768 to +32767
Hexadecimal format :&H0000 to &HFFFF
Real type:Single-precision fixed-point format(Entry digits: 7, Effective digits: 6)
Single-precision floating-point format (Entry digits: 7, Effective digits: 6)
VARIABLES
A variable name should be a max. of 10 characters, including alphanumerics and periods, and must start
with a letter. The max. number of variables is 256.
Integer type:A “%” should be attached to the end of the variable name.
Single-precision real type:A “!” should be attached to the end of the variable name.
The assignment value is in the same range as a numeric constant.
Character type: A ‘$’ should be attached to the end of the variable name.
The assignment value is in the same range as a character constant.
The max. 16 dimensions and 32767 subscripts for an array variable are allowable. However, a
subscript starts from 0, and the practical number of elements is the number of subscripts + 1. 32
bytes are used per one array. An array exceeding 32 bytes cannot be used.
- 1 -
OPERATORS
Arithmetic operators:
OperatorOperation
^Exponential operation
-Sign
*, /Multiplication, Real division
¥Integer division (The quotient is output.)
MODInteger division (The remainder is output.)
+, -Addition, Subtraction
The operations enclosed in parentheses are processed first.
Relational operators: Compares between two values. The result is true or false.
OperatorOperation
=Equal to
<>, ><Not equal to
<Less than
>Greater than
<=, =<Less than or equal to
>=, =>Greater than or equal to
Logic operators:Checks more conditions, performs bit handling.
OperatorOperation
NOTNegation
ANDLogic product
ORLogic OR
XORExclusive-OR
Function Erases the specified array from the program.
REMFormatREM [ <comment> ]
’ (Apostrophe)Function Enters a comment into the program.
STOPFormatSTOP
Function Terminates the execution of the program, and returns to the command
level state.
ENDFormatEND
Function Terminates the execution of the program, closes all opened files, and
returns to the command level state.
General instructions
Statement
DATAFormatDATA <constant> [, <constant> ] ···
Function Sets a numeric value or a character constant read by the READ
statement.
READFormatREAD <constant> [, <constant> ] ···
Function Reads a value defined by a DATA statement and assigns it to a variable.
RESTOREFormatRESTORE
Function Starts reading from the first one of the DATA statements to be read by
the READ statement.
GOTOFormatGOTO <line number>
Function Moves the execution to the specified line without any conditions.
GOSUBFormatGOSUB <line number>
Function Calls the subroutine program.
ON GOTO
/GOSUB
ON <expression> GOSUB <line number> [, <line number> ] ···
Function Branches the execution to the specified line number according to the
value for <expression>.
Function Declares the end of a subroutine, and returns the execution to the
location where the subroutine was called up.
- 3 -
IF ~ THEN ~
ELSE
FormatIF <expression> THEN <statement>[ELSE <statement>]
<line number><line number>
IF <expression> GOTO <line number>[ELSE <statement>]
<line number>
Function Judges the condition, and changes the flow of the program.
FOR ~ NEXTFormatFOR <variable> = <initial value> TO <terminal value> [STEP <increment> ]
NEXT [ <variable> [, <variable> ] ···]
Function Executes the statements included from the FOR statement to the NEXT
statement repeatedly while the given conditions are satisfied.
WHILE
~ WEND
FormatWHILE <expression>
WEND
Function Repeats the statements included between the WHILE statement and the
WEND statement for as long as the given conditions are satisfied.
CHAINFormatCHAIN <file designation> [, ALL]
Function Executes another program.
COMMONFormatCOMMON <variable name> [, <variable name> ] ···
Function Declares the variable is to be passed from the original program to the
program called by the CHAIN statement.
Numeric process
Statement
ABSFormatABS ( <numeric expression> )
Function Provides the absolute value.
INTFormatINT ( <numeric expression> )
Function Provides the max. integer value not exceeding the specified <numeric
expression>.
CINTFormatCINT ( <numeric expression> )
Function Provides the integer value to which the real value is converted.
CSNGFormatCSNG ( <numeric expression> )
Function Provides the value which is converted to the single-precision real value.
SGNFormatSGN ( <numeric expression> )
Function Provides a sign for <numeric expression>.
- 4 -
Character string process
Statement
ASCFormatASC ( <character string> )
Function Provides the character code (ASCII) for the first character of the
Function Reads the character string with the specified length from the keyboard or
the file.
PRINT#FormatPRINT# <file number>, [USING <format control character string> ; ],
<expression list>
Function Outputs data (numeric value or character string) to the sequential file.
WRITE#FormatWRITE# <file number>, <expression list>
Function Outputs data to a sequential file.
FIELD#FormatFIELD [#] <file number>, <field width> AS <character variable> ]
[,<field width> AS <character variable> ] ···
Function Allocates the variable area to the random file buffer. (Record definition)
GET#FormatGET [#] <file number> [, <numeric value> ]
Function Inputs the data in a file into the buffer.
PUT#FormatPUT [#] <file number> ) [, <numeric value> ]
Function Outputs the data to the file.
EOFFormatEOF ( <file number> )
Function Checks the end of the sequential file, or whether or not the
communication buffer becomes empty.
LOCFormatLOC ( <file number> )
Function Provides the current theoretical location in the file.
LOFFormatLOF ( <file number> )
Function Provides the size of the file.
- 8 -
ABS
FunctionProvides the absolute value.
FormatABS ( <numeric expression> )
ExplanationThe absolute value for <numeric expression> (0 or a positive value) is provided as a
function value.
- 9 -
ASC
FunctionProvides the character code (ASCII) for the first character of the character string.
FormatASC ( <character string> )
ExplanationThe character code for the first character (left side) of <character string> is provided.
If <character string> is a null string, an error occurs.
- 10 -
BEEP
FunctionSounds the internal buzzer.
FormatBEEP
ExplanationThe internal buzzer is sounded for 100 ms.
- 11 -
CHAIN
FunctionLoads another program, and executes it.
FormatCHAIN <file designation> [, ALL]
Term<file designation>: The program file to be executed should be specified.
(The file name should be included.)
ExplanationThe program designated in <file designation> is executed.
CHAINCHAIN
Program 1
If the ALL option is designated, all variables are passed. If it is necessary to pass
variables when the ALL option is omitted, the COMMON statement should be used.
CHAIN ”PROG2”, ALL
The CHAIN statement holds any file which has already been opened as is.
Program 3Program 2
- 12 -
CHR$
FunctionConverts the character code (ASCII and internal sequence code) to a character.
Term<numeric expression>:The numeric expression within the range between 0 and 255
(&H0 to &HFF) indicating ASCII code
ExplanationThe CHR$ function regards a value for <numeric expression> as ASCII code, and
converts it to a character. The CHR$ is the opposite of the ASC function.
- 13 -
CINT
FunctionProvides the integer value to which a real value is converted.
FormatCINT ( <numeric expression> )
ExplanationThe value for <numeric expression> is rounded off to the nearest whole number,
making it into an integer.
- 14 -
CLEAR
FunctionInitializes a variable.
FormatCLEAR
ExplanationThe memory used for storing data is freed without deleting any programs in the
memory. After the CLEAR statement is executed, all numeric variables and
character variables become 0 and null strings (“”), respectively. The array declaration
becomes invalid. All files are closed.
The CLEAR statement executes the following processes.
1. All files are closed.
2. All COMMON statements and user variables are initialized.
3. The stack area and character area are initialized.
The ERASE statement is similar to the CLEAR statement. For the CLEAR statement,
all variables are initialized, however, for the ERASE statement, only the specified
array variable is initialized.
Term<file number>:The number assigned to the file or the device by the OPEN
statement
ExplanationThe file corresponding to <file number> is closed. One or more <file number>s can
be specified once in the CLOSE statement. If <file number> is omitted, all opened
files are closed.
Once a file has been closed, its number can be used for opening another file. The
closed file can be opened by specifying the same file number as the previous one or
a different file number.
For a file that has been opened for an output, the data remaining in the buffer is
output by the CLOSE statement.
The END statement closes all opened files automatically.
- 16 -
CLS
FunctionClears the screen.
FormatCLS
- 17 -
COMMON
FunctionDeclares the variable is to be passed from the original program to a program called
Term<variable name>: The variable name to be passed should be specified.
ExplanationThe COMMON statement is used together with the CHAIN statement, and declares
that a variable is to be passed from the original program to a called program.
The same variable name cannot be used more than once in the COMMON statement.
When the array variable is passed, two parentheses “( )” should be inserted after the
variable name to indicate it is an array.
When all the variables are to be passed, not the COMMON statement but the ALL
option in the CHAIN statement should be used.
A COMMON statement should be placed before the CHAIN statement.
When an array is to be passed to a called program, the array declaration should not
be performed by the DIM statement. However, it is necessary to previously perform
the array declaration by the DIM statement in the program to be called.
- 18 -
COM ON/STOP
FunctionEnables/Stops an interrupt from the RS-232C communication file.
FormatCOM ( <line number> ) ON
COM ( <line number> ) STOP
Term<line number>: The RS-232C interface number (1 or 2)
ExplanationThe interrupt which occurs when the communication flows to the RS-232C from an
external source is enabled by the COM ( <line number> ) ON statement, or stopped
by the COM ( <line number> ) STOP statement.
When the COM ( <line number> ) ON statement is used, an interrupt should be
enabled previously by the ON COM statement. Then, an interrupt occurs every time
data is input through the RS-232C interface, and the process specified by the ON
COM statement is performed.
When the COM ( <line number> ) STOP statement is executed, an interrupt does not
occur if data is input, however, the fact that data has been input is stored. After that,
when the interrupt is enabled by the COM ( <line number> ) ON statement, the
interrupt occurs immediately, and then the process is performed.
The COM ( <line number> ) STOP statement is used to prevent the process from
being suspended by the occurrence of an interrupt.
When a communication interrupt is detected according to <line number> n, the
interrupt routine executes the COM ( <line number> ) STOP statement automatically,
and disables the interrupt which is being processed. The execution is automatically
returned from the interrupt routine to the previous setting state.
- 19 -
CSNG
FunctionProvides a value which is converted to a single-precision real value.
FormatCSNG ( <numeric expression> )
ExplanationThe value for <numeric expression> is converted to a 7-digit single-precision real
value.
- 20 -
CVI/CVS
FunctionProvides a value for numeric value data which is converted to the numeric data.
FormatCVI ( <2-byte character string> )
CVS ( <4-byte character string> )
ExplanationAll numeric values in the random file on the disk are converted to the character string
type. This function returns the numeric data converted to the character string type to
a numeric value.
CVI converts the first 2 bytes (2 characters) to an integer. CVS converts the first 4
bytes (4 characters) to a single-precision real value.
- 21 -
Loading...
+ 55 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.