GetValue function

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.

value = GetValue(lp_data, DATA_TYPE, data_length)

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_TYPESpecifies 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_lengthLength of data. Specify this argument only if the data type is a string.
DATA_TYPEType of data lp_data points to
CharString.
ByteSigned char (1 byte).
UbyteUnsigned char.
ShortSigned short int (2-byte integer).
UshortUnsigned short int.
LongSigned long (4-byte integer).
FloatFloat (4-byte BASIC+).
DoubleDouble (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.

  • guides/programming/programmers_reference_manual/getvalue.txt
  • Last modified: 2024/10/14 18:18
  • by 127.0.0.1