Language
Fundamentals |
|||||||||||||||||||||||||||||||

Characters from the
BASCOM character set are put together to form labels, · The specific characters
in the character set and the special meanings of some characters.
ENTER Terminates input of a line Blank ( or space) ' Single quotation mark (apostrophe) * Asterisks (multiplication symbol) + Plus sign , Comma - Minus sign . Period (decimal point) / Slash (division symbol) will be handled as \ : Colon " Double quotation mark ; Semicolon < Less than = Equal sign (assignment symbol or relational operator) > Greater than \ Backslash (integer/word division symbol) The BASCOM program line BASCOM program lines have the following syntax: [[line-identifier]] [[statement]] [[:statement]] ... [[comment]] Using Line Identifiers BASCOM support one type of line-identifier; alphanumeric line labels: An alphabetic line label may be any combination of from 1 to 32 letters and digits, starting with a letter and ending with a colon. BASCOM keywords are not permitted. The following are valid alphanumeric line labels: Non executable statement
perform tasks such as allocating storage for variables, declaring and
defining variable types. · A " comment"
is a nonexecutable statement used to clarify a programs operation and
purpose.
Bytes are stores as unsigned 8-bit binary numbers ranging in value from 0 to 255.
Integers are stored as signed sixteen-bit binary numbers ranging in value from -32,768 to +32,767.
Words are stored as unsigned sixteen-bit binary numbers ranging in value from 0 to 65535.
Longs are stored as signed 32-bit binary numbers ranging in value from -2147483648 to 2147483647.
Singles are stored as signed 32 bit binary numbers.
Strings are stored
as bytes and are terminated with a 0-byte. Variables can be stored internal (default) or external.
A = 5
abc = def
operators: Temp = a + 5 This chapter describes
how expressions are formed and concludes by describing the following kind
of operators: · Arithmetic operators,
used to perform calculations. Operators perform
mathematical or logical operations on values. Arithmetic Arithmetic operators are +, - , * and \.
· Integer Integer division is
denoted by the backslash (\). · Modulo Arithmetic Modulo arithmetic
is denoted by the modulus operator MOD. · Overflow and division by zero Division by zero, produces an error. At this moment there is no message, so you have to insure yourself that such wont happen.
An eight-bit exponent
and 24 bit mantissa are supported. 31 30________23 22______________________________0 The exponent is biased
by 128. Above 128 are positive exponents and All mathematical operations are supported by the single. You can also convert
a single to an integer or word or vise versa:
The index must be a numeric constant, a byte, an integer or a word. This means that an array can hold 65535 elements as a maximum. The minimum value is 1 and not zero as in QB. Arrays can be used
on each place where a 'normal' variable is expected but there are a few
exceptions. For C = 1 To 10
You can concatenate string with the + sign. Dim S As String *
10 , Z As String * 10 In QB you can assign
a string with a value and add the original string (or a part of it) too
:. This will result in
the string "atest" |