
BASIC comparison sheet ProgsVarsMem Page 7
Programs, Variables and Memory
Vendor
Model
Variables
Numeric range
String variables
String too long
String literals
Character set
Lower case
Arrays
String arrays
Array dimensions
Automatic DIM
Clear variables
Programs, Variables and Memory
HP TI Tandy Radio Shack Canon Epson
HP-75 HP-71 TI-74 CC-40 TRS-80 Mod. 100 X-07 HX-20
Default is REAL. Default is double precision. Default is single precision.
BCD, 13 digits, exponent range -128..+127.
ERR:Excess Chars E3 Mismatch LS Error
"String with 'quotes' ", 'String with "quotes" ' "String with ""quotes"" " "String", quotes inside string literals are not supported.
ASCII + symbols ASCII + symbols. National ASCII + symbols.
Yes Yes
Arrays of different types are independent from each other.
N/A
Arrays of dimension (10), (10,10) or (10,10,10) or more can be created implicitly by an assignment.
CLEAR VARS
N/A N/A N/A ERASE deletes selected arrays.
ERASE deletes selected arrays.
A-Z, A0-A9..Z0-Z9. Variables are independent but arrays and
simple variables cannot share the same name. Undefined
variables return 0.
Variables are local to the running program or procedure.
Long variable names, case insensitive, up to 15 chars,
@ and _ allowed. Variables may even start with a
keyword. Longer names result in error. All variables are
automatic and independent. Variables are created by a
manual assignment or automatically by RUN if used in a
program. Variables are created before the program is
executed, so all used variables are defined. Use of
undefined variables in command mode results in an
error.
Variables in procedures are local to the procedure but
can be made persistent between calls by
ATTACH <procedure>.
Two character variable names, case insensitive. Must not contain keyword. Longer
names are truncated. All variables are automatic and independent. Undefined
variables return 0.
Long variable names, case insensitive, up
to 32 chars. Must not start with keyword.
Longer names are truncated. All variables
are automatic and independent. Undefined
variables return 0.
REAL, SHORT and INTEGER declare variables with standard,
half or integer precision.
DEFDBL, DEFSGL, DEFINT <letter range> and suffixes #, ! and % allow double or single precision and 16 bit signed integers.
Variables of different types are independent from each other.
Default is double precision.
All float constants are double precision.
Like HP-71 but
not IEEE. SHORT
exponent range
+/-99.
BCD, 12 digits or 5 digits, exponent range
+/-499. Special values for NaN and Inf
(IEEE standard). Integers are BCD with 5
digits and no exponent. Some internal
computations use 15 digits.
Integer: 16 bit signed, -32768..32767.
Single precision: 32 bit binary float (ca.7 digits), exponent range -64..+62.
Double precision: 64 bit binary float (ca.14 digits), exponent range -64..+62.
Double precision numbers have a D exponent or a trailing #.
A$-Z$, A0$-A9$..Z0$-Z9$. DIM A$[L] sets string length to L.
Default is 32, maximum is memory dependent. String
allocation is static. String variables are independent but
arrays and simple variables cannot share the same name.
Undefined string variables return an empty string.
String variable names follow the rules of numeric
variables+$. String length is dynamic up to 255
characters. String variables are created by a manual
assignment or automatically by RUN if used in a
program. Use of undefined string variables results in an
error.
String variable names follow the rules of numeric variables+$.
String length is dynamic up to 255 characters. Undefined string variables return an empty string.
DEFSTR <letter range> allows names without $.
DIM A(...) defines array. REAL, SHORT or INTEGER A(...)
define arrays of certain type. See above for naming
restrictions.
DIM Name(...) defines array. Array names follow the
rules of numeric variables. DIM statements are static
declarations and must appear above any reference to
the array in the program. DIM cannot appear after
THEN or ELSE. After a DIM statement only comments
are allowed on the same line.
DIM Name(...) defines array.
Array names follow the rules of numeric variables.
Static declaration
like TI-74.
Dimension and size can be expressions.
Existing arrays can be redimensioned
without data loss.
DIM A$(n)[L] defines string array and sets
string length to L. See above for naming
restrictions. Only one dimension allowed.
Default length is 32, maximum is memory
dependent.
DIM Name$(...) defines string array.
Array names follow the rules of numeric variables.
String length is dynamic up to 255 characters.
See above for DIM statement restrictions.
DIM Name$(...) defines string array.
String array names follow the rules of string variables.
String length is dynamic up to 255 characters.
Two dimensions. Size is only limited by memory. OPTION
BASE 0 or 1 set the lowest index for next DIM statement.
Three dimensions. Size is only limited by memory.
Dimensions must be constant.
Number and size of dimensions is only limited by memory. Dimensions can be
expressions.
Limits see left.
OPTION BASE 0 or 1 set the lowest index
for all arrays.
Arrays of dimension (10) or (10,10) can be created
implicitly by an assignment.
Arrays of dimension (10), (10,10) or (10,10,10) can be
created implicitly by an assignment.
DESTROY ALL deletes all variables and
arrays.
Program editing, power cycling, NEW or RUN delete all
variables.
Power cycling, NEW, RUN or CLEAR delete all variables.
DESTROY deletes selected variables or
arrays.
CALL CLEANUP clears
variables not used by the
program.
SLEEP turns power of without deleting the
variables.
Kommentare zu diesen Handbüchern