Pointer

See Also: Declaring Variables, Variable Declaration Commands, Struct, AddressOf Function

Purpose

Declares one or more Pointer variables.

Syntax

To declare Pointer variables

Pointer {identifier} [… {identifier}]

Where

To declare array variables of type Pointer

Pointer{dimension-list} {identifier} […{identifier}]

Where

What It Does

DataFlex Pointer types are used to declare variables for storing the memory address of a string variable.

Multiple variables may be declared on one command line, with their names separated from each other by spaces.

You can assign a value to a pointer variable with the AddressOf function. This command will retrieve the memory address of a named variable and return it to the pointer variable.

Examples

Procedure Test

    Pointer lpComputerName

End_Procedure

This example declares a Pointer variable named lpComputerName.

 

Pointer[] lpDiskDriveInfo

This example declares 1 dynamic array variable, named lpDiskDriveInfo, containing an undefined pointer of elements of type pointer.

Pointer[5] lpDiskDriveInfo

This example declares 1 static array variable, named lpDiskDriveInfo, containing 5 of elements of type pointer.

Pointer[][3] lpDiskDriveInfo

This example creates a two-dimensional dynamic array variable named lpDiskDriveInfo, containing an undefined pointer of elements of type pointer. Conceptually, this represents a rectangular array with an undefined pointer of rows, each of 3 columns.

You can declare dynamic multi-dimensional arrays where all dimensions are dynamic; these are called jagged arrays.

Notes