Omron SYSMAC C200H-ASC02 Operation Manual page 31

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

Program Configuration
Character Constants
Integer Constants
Octal Constants
Hexadecimal Constants
Floating Point Constants
1, 2, 3... 1.
1, 2, 3... 1.
Variables
Variable Name
Type Declarator
Constants
Character
Numeric
A character constant is a character string enclosed by double quotation
marks ("). It can be up to 255 characters long. If it has no character, it is
called an "empty character string" or a null string.
Example:
"CF-BASIC"
Whole numbers between -32768 and 32767 can be used. An optional per-
cent sign (%) can be added to specifically indicate an integer constant. Inte-
ger constants do not have decimal points.
Examples: 1234
-1234
Octal numbers 0 through 7 beginning with the prefix "&" and within the range
of &0 to &177777 can be used.
Examples: &0127
&7777
Hexadecimal numbers with the prefix "&H", from 0 to F (0 to 9,A,B,C,D,E,F)
and in the range &H0000 to &HFFFF can be used.
Examples: &H5E
&HBF4
Single precision: This type of constant is stored with seven-digit precision
and is output as a six-digit constant with the seventh digit rounded off. It is
represented by one of the following methods:
As a number with seven or less digits: 1234.5
2.
As a number in exponential form using E: 1.2E+3
3.
As a number with the character "!" at the end: 2.34!
Double precision: This type of constant is stored with 16-digit precision and is
output as 16 digits or less. It is represented by one of the following methods:
As a number with 8 or more valid digits: 1.23456789
2.
As a number in exponential form using D: -1.2D-3
3.
As a number with the character "#" at the end: 2.34#
Variables are names used to represent values that are used in a BASIC pro-
gram. The value of a variable may be assigned as the result of calculations
or explicitly by the programmer with an assignment statement. If no value is
assigned to a numeric variable, it is assumed to be zero. If no value is as-
signed to a character variable, it is assumed to be a null string.
A variable may be up to 255 alphanumeric characters long, but only the first
16 characters are actually valid. No variable can start with "FN" or a valid
BASIC command name.
If a parameter begins with a reserved word, syntax error will occur. TOTAL
and ABSOL, for example, cannot be used because they include reserved
words TO and ABS. Syntax errors will result if these parameters are used.
The variable TYPE must be declared. This is done using a type declarator
which is placed after the variable name. Even if two variables have the same
name, they will be treated differently if they are declared as different types of
variables.
Integer
Real Number
12
Section 4-1
Decimal
Octal
Hexadecimal
Single-precision
Double-precision
21

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents