Programming guide to Unibase

8 : Types and operators

Basic operators

and or not Boolean algebra
< > <= >= <> = Boolean expressions
Minus
Add
Modulo
Divide
Multiplication
function(parametersCall to a function
pointer.field Get field of table. When the field is a pointer there can multiple points.
var = expression Set a new value in a variable or field. Fields are only allowed within Edit- or Add-statement.
var += expression 
var -= expression 
var *= expression# 
(expressionEvaluation priority brackets
 

List of standard types

Number Normal numbers. These number range approximately from -2.000.000.000 till 2.000.000.000
Real Real numbers. Normally written in 'sientific' notation.
Sort The field is used to create a fixed order to a table. It must always be the last field of the key index.
String The field holds text. This can be a single line till a total essay.
Enumerate The field is restricted to a given set of values. The type is written as: "[value1 value2 ...]"
Pointer Relation to a record in an index. The type is written als "^index" or "pointer" for a general pointer.
Time Date and time field.
Byte Short number ranging from 0 till 255.
Boolean Only two values 'false' and 'true'.
ConStr Constant strings, normally only for optimisation purposes.
Stream In- and output streams. Normally pointing to files.
 
This list is not finished. There will be more types coming up soon. Also people are encouraged to create their own project dependend types. Especially intensly used fixed length tables or pictures should be put in types to get them stored in the best way. There is already a socket type.

Standard functions

The standard functions are all collected in one module.

Type conversion

Within the language an expression of a different type can often be put in a variable or parameter of another type. This prevends the writing and learning of a long list of type conversion functions. I tried to define the most logical conversions and to restrict myself to the most needed ones. There will be people around that do not like my choices but the current choices are consistent. People are free to change it but there isn't much room for improvement left.