Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter ThreeData Types and Operators (continued)

GetVariablePointer Function

Overview

The GetVariablePointer function returns a pointer (address to a memory location) to a specified variable.

Syntax/Parameters

Syntax

dword = GetVariablePointer ( variable name );

Parameters

name

A name of a variable.

Return Value

Returns a dword containing a 32-bit pointer value or zero (NULL) on failure. Use the GetLastError and GetLastErrorMessage functions to retrieve additional information.

Remarks

Certain external functions may need access to the actual memory address of specific data. This function is provided specifically to support DLL and Windows SDK access for advanced functions such as message processing.

The returned value is a raw pointer to a memory address of some size. To get the size, use the GetVariableSize function.

Pointers are transient in nature and must be used with caution. This is particularly true for referenced strings and local variables. For example, if a pointer is retrieved for a string and that string is later replaced or the internal pool is reallocated, the pointer may become invalid. For this reason, pointers should be retrieved and immediately used and then discarded.

Caution must be exercised for functions that may write to pointer locations since they may write beyond the bounds of allocated memory. This may result in a program exception, or worse, an undetected data corruption.

This function operates on certain variable types. Referencing a string that has not been initialize will result in an error.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic