def • variable

variable

A variable is a symbol associated with an Object or a Method that can be either read or written.

Each variable must have a datatype. i.e. String, Integer, etc.

A variable can be public, private or local.

Only classes written in Gambas can declare public variables.

A variable is faster to access (because it accesses memory directly for reading and writing its value) than a Property, but you have no control on it.

In order to use a variable you must declare it either in the beginning of the Class or in the beginning of the procedure.

In VB Variables can be declared "inside" the code.

Beware that variables whose datatype is Object, any array, or any class, are initialized with NULL.

You must initialize them with a real object created with the NEW keyword before using them.

See also