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.

ParameterDescription
lp_dataA 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).

Variable TypeType of data lp_data points to
CharString.
ByteSigned char (1 byte).
Variable TypeType of data lp_data points to
UbyteUnsigned char.
ShortSigned short int (2-byte integer).
UshortUnsigned short int.
LongSigned long (4-byte integer).
FloatFloat (4-byte BASIC+).
DoubleDouble (8-byte BASIC+).
Data_lengthLength of data. Specify this argument only if the data type is a string.

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.

See also

GetPointer()LockVariableUnlockVariable

  • No labels