Description

Locks a BASIC+ variable, so that its data does not move in memory. Used in conjunction with GetPointer.

Syntax

LockVariable variable As VARIABLE_TYPE

Caution: In the syntax for LockVariable, VARIABLE_TYPE is not quoted, although it is a literal. VARIABLE_TYPE should not be quoted. Quoting this parameter will cause compiling errors and unpredictable results.

Parameters

LockVariable has the following parameters.

ParameterDescription
VariableA BASIC+ variable name. The name cannot be an expression.
VARIABLE_TYPESpecifies the type of data referenced by variable.

LockVariable is required because garbage collection is OpenInsight can move values. If the return value from GetPointer() is being assigned to a variable, LockVariable the variable first before passing it to GetPointer. Always make sure that a variable locked with LockVariable is released with UnlockVariable.

Data Types

The following table shows C data types and the corresponding OpenInsight Engine-level data types.

C data typeOpenEngine-level Data Type
CharString.
Byte, UbyteLong.
Short, UshortLong.
LongLong.
FloatDouble.
DoubleDouble.
LPVoidLong.
LPCharString.
LPByte, LPUByteLong.
LPShort, LPUShortLong.
LPLongLong.
LPDoubleDouble.

See also

GetPointer()GetValue()UnlockVariable

  • No labels