Please enable JavaScript to view this site.

A-Shell Reference

ASB expressions are combinations of variables, literal values, operators, functions and parentheses that can be reduced to a single value. Generally speaking, wherever you can use a single value or variable in a source rather than destination context, you can use an expression of arbitrary complexity. Although there are several types of variables, there are only two fundamental types of expressions: numeric—which evaluate to a floating point value—and string—which evaluate to a string. Mostly this is all quite familiar and intuitive, although there are few quirks—"mode independence", the Overloaded Plus Operator, and Boolean Bit-wise Arithmetic, which see for more discussion.

Mode Independence

This mysterious term, brought over from the original AlphaBASIC, refers to the ability to use and intermix string and numeric expressions, with the compiler and runtime interpreter performing conversions as necessary for the operations to make sense. For example, since multiplication only makes sense with numeric operands, if you supply string operands, they will be converted to numeric expressions automatically before the multiplication is performed. If a string starts with non-numeric characters, the corresponding value is simply zero. This is all fairly straightforward for operators and statements that expect a certain type of operand; the confusion comes with the Plus operator, which works with both strings and numbers.

See Also

Subtopics

Constants and Literals