GB.ReturnPtr

void GB.ReturnPtr ( GB_TYPE type , void * value )

Returns a value stored in memory.

type is the Gambas datatype of the value.

value is the address of the value in memory.

This function is mainly used by container classes like Array classes, Collections to return the data they stored.

Gambas datatype stored What address must point at Size
Boolean unsigned char 1 byte
Byte signed char 1 byte
Short short 2 bytes
Integer long 4 bytes
Float double 8 bytes
Date GB_DATE_VALUE 8 bytes
String char * 4 bytes
Object void * 4 bytes
Variant GB_VARIANT_VALUE 12 bytes

The return value is automatically converted to the class specified in the method or property signature.

Be careful ! This function does not abort the method or property. You must explicitely return from it by using the return instruction.


Referenced by :