OWBasic for Pocketviewer

Home INTRO Group PROGRAMMING Alphabetical Index

Expression and assignments

Expressions are syntactical constructions, that represent a value. They are necessary as parameters for procedures and functions and as the right side of assignments. Boolean expressions are used also as conditions for conditional operations( IF).

Like variables expressions have a datatype.

Basic parts of expressions are:

- constants, e.g. 3, 3.12, "a string", true
- variables, e.g. A, F#, valid!
- operators, e.g. +, -, AND, OR
- functions, e.g. SIN#(F), SQR()

Assignments have the form:

<variable> = <expression>

The value of expression is assigned to the variable. That means, that variable gets the new value represented by expression and the old value of variable is lost. An expression is constant if it can be evaluated at compile time, e.g. 5*(9-7) . The functions VARDEF and PROCFUNCDEF return a constant value, so do the functions INT, CHAR, ASC if the parameter is constant.
Constant expressions can be used as condition in directives.

Home INTRO Group PROGRAMMING Alphabetical Index