Pointers
Pointers are a special kind of variables which act as a reference to another variable (the 1pointed variable). The value of a pointer is, in fact, the address of the pointed variable; in order to access the data stored at the address pointed to, pointers can be dereferenced.Pointer declaration requires the same syntax used in variable declaration, where the type name is the type name of the pointed variable preceded by a @ sign:VAR : @;END_VARFor example, the declaration of a pointer to a REAL variable shall be as follows:VARpx : @REAL;END_VARA pointer can be assigned with another pointer or with an address. A special operator, ADR, is available to retrieve the address of a variable.px := py; (* px and py are pointers to REAL (that is, variablesof type @REAL) *)px := ADR( x ) (* x is a variable of type REAL *)px := ?x (* ? is an alternative notation for ADR *)The @ operator is used to dereference a pointer, hence to access the pointed variable.px := ADR( x );@px := 3.141592; (* the approximate value of pi is assigned to x *)pn := ADR( n );n := @pn + 1; (* n is incremented by 1 *)Beware that careless use of pointers is potentially dangerous: indeed, pointers can point to any arbitrary location, which can cause undesirable effects.Using of PVOID typeBeware that the pointer type and the pointed variable type must be of the same type; else an error message is raised when compiling. To avoid type mismatching you can use PVOID type as pointer type, this way the pointed type will be always accepted.