MAINSAIL Language Manual, Section 32.93

previous   next   top   contents   index   framed top   this page unframed


32.93. cvp

Figure 32–102. cvp (GENERIC)
$BUILTIN
POINTER
PROCEDURE   cvp         (ADDRESS a);

$BUILTIN
POINTER
PROCEDURE   cvp         (ARRAY a);

$BUILTIN COMPILETIME
POINTER
PROCEDURE   cvp         (POINTER p);

$BUILTIN SPECIAL
POINTER
PROCEDURE   cvp         (CLASS cls);

cvp converts to POINTER.

The ADDRESS form converts an ADDRESS to a POINTER. The result is undefined unless the ADDRESS either is NULLADDRESS or points to a dynamic object allocated by the MAINSAIL runtime system; in the former case the result is NULLPOINTER.

The ARRAY form returns a POINTER to the dynamic ARRAY object to which a points. (The form of a dynamic ARRAY object is not documented and is subject to change without notice.) The conversion is only syntactic; no data are allocated or copied. If a is NULLARRAY, NULLPOINTER is returned.

The POINTER form returns its argument.

The CLASS form returns a CLASS descriptor for cls; it is equivalent to $classDscrFor (see Section 32.20).

cvAry may be used to convert a POINTER into a dynamic ARRAY.

Example 32–103. Use of cvp
INTEGER ARRAY(1 TO 8) a;
POINTER p;
...
p := cvp(a); # p points to the ARRAY a points to


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 32.93