User guide
23
VTB USER GUIDE
It's also possible to declare pointers to data STRUCTURES.
Example
This structure is been declared
Used variables:
pointer as *Example ‘ pointer to structure Example
struct as Example ‘ struct is a structure type variable
pointer=struct() ‘ pointer points to structure
pointer->Var1=300 ‘ writing of both fields of structure by pointer
pointer->Var2=200
As we have seen, to use pointer with the structures we need the token →
WARNING: VTB doesn't make any control on the index of pointer therefore with pointers it's possible to write anywhere
in memory with consequent risks to crash the system.
Example:
pnt as *long
value as long
pnt=value()
pnt[10]=1234
The inscrution punt[10] = 1234 doesn't generate any compiling or run-time error, but it can cause unexpected
operations. The correct use is:
pnt[0]=1234
To get the address of a function to assign to a variable we have to refer at the function simply with its name (without
brackets):
Example
VarPnt=MyFunction
Where MyFunction is a declared function