GB.Store

void GB.Store ( GB_TYPE type , GB_VALUE * src , void * dst )

Store a Gambas value into memory.

type is the Gambas datatype of the value.

src points at the value.

dst is the memory address where the value will be 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

If something was stored in dst, it is released before being replaced by the new value, depending on the dataype found : String and Object need being released, not the other datatypes.

Use this method only if you don't know the datatype at compile time.

Otherwise, use the specialized methods : GB.StoreString, GB.StoreObject, and GB.StoreVariant.

If you want to store the other datatypes (Integer, Date, ...), store them directly in memory. It is faster !


Referenced by :