GetValue function
Description
De-references a pointer, and copies the data to a BASIC+ variable. The variable type is passed in the call. GetValue() is the opposite of GetPointer(). GetPointer() returns the pointer to a value; GetValue returns the value from a pointer.
Syntax
value = GetValue(lp_data, DATA_TYPE, data_length)
Parameters
The GetValue function has the following parameters.
Parameter | Description |
---|---|
lp_data | A four-byte pointer. For example, lp_data could be the pointer returned by the Windows function GlobalLock. |
DATA_TYPE | Specifies the type of data to which lp_data points. Return value types are shown in the following rows. Note that DATA_TYPE is a literal, not a variable (refer to the Caution, below). |
Data_length | Length of data. Specify this argument only if the data type is a string. |
DATA_TYPE | Type of data lp_data points to |
---|---|
Char | String. |
Byte | Signed char (1 byte). |
Ubyte | Unsigned char. |
Short | Signed short int (2-byte integer). |
Ushort | Unsigned short int. |
Long | Signed long (4-byte integer). |
Float | Float (4-byte BASIC+). |
Double | Double (8-byte BASIC+). |
Caution: In the syntax for GetValue, DATA_TYPE is not quoted, although in this instance DATA_TYPE is a literal, not a variable. Quoting this parameter will cause compiling errors and unpredictable results.