Caution: This function provides access to pointers used by the system. Improper use of the pointer returned by this function may cause your application to crash. The targeted data should be locked prior to retrieving the pointer by using the LockVariable statement.

Also be aware that the data type (in the following example, Char) is not quoted, although it is a literal and not a variable. Quoting this parameter will cause compiling errors and unpredictable results.

Description

Returns a pointer to the contents of a BASIC+ variable (cannot be expression).

Syntax

lprevdata = GetPointer (variable)

Remarks

Calling GetPointer for a dimensioned array or an unassigned variable will generate an error. Use the LockVariable statement to lock the string, prior to retrieving the pointer.

See also

GetValue()LockVariableUnlockVariable

Example

/* This code formalizes the memory variable as type Char, 
then returns a pointer to that memory data, for use by any code that uses pointers. */
 
LockVariable StringData As Char
lpRefData = GetPointer(StringData)
/* value will hold a 14-character string of characters */
value = GetValue(lpRefData, Char, 14)
UnlockVariable StringData
  • No labels