Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== LockVariable statement ====== ==== Description ==== Locks a BASIC+ variable, so that its data is "coerced" to the proper data type. Used in conjunction with GetPointer. ** NOTE: ** LockVariable has been deprecated in favor of [[ensurevariable|EnsureVariable]]. ==== Syntax ==== **LockVariable** //variable// As //VARIABLE_TYPE// **//{{{guides:programming:programmers_reference_manual:caution.gif?28x21}}// 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. ^Parameter^Description^ |//Variable//|A BASIC+ variable name. The name cannot be an expression.| |//VARIABLE_TYPE//|Specifies the type of data referenced by variable.| LockVariable is required because OpenInsight is an "untyped" language, and variables do not have specific data types, while calls to external routines require the variable to be a specific type. If the return value from GetPointer() is being assigned to a variable, LockVariable the variable first before passing it to GetPointer. === Data Types === The following table shows C data types and the corresponding OpenInsight Engine-level data types. ^C data type^OpenEngine-level Data Type^ |Char|String.| |Byte, Ubyte|Long.| |Short, Ushort|Long.| |Long|Long.| |Float|Double.| |Double|Double.| |LPVoid|Long.| |LPChar|String.| |LPByte, LPUByte|Long.| |LPShort, LPUShort|Long.| |LPLong|Long.| |LPDouble|Double.| ==== See Also ==== [[getpointer|GetPointer()]], [[getvalue|GetValue()]] guides/programming/programmers_reference_manual/lockvariable.txt Last modified: 2024/10/14 18:18by 127.0.0.1