Handle

See Also: Declaring Variables, Variable Declaration Commands, Struct, Integer

Purpose

Declares one or more Handle variables.

Syntax

Handle {identifier} […{identifier}] 

Where

To declare array variables of type Handle

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

Where

What It Does

The Handle command declares handle variables. The DataFlex handle type is an alias for Longptr.

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

DataFlex handle types are used to declare variables for storing references to some other identifier, such as an object, a message, a table, an operating system handle and so forth.

Examples

Handle hoButton hmMessage hTable hWnd

 

Move oMyOkButton To hoButton  // moves a reference to a Button object to a handle

Move msg_MyProcedure To hmMessage  // moves a reference to a Procedure method to a handle

Move MyTable.File_Number To hTable  // moves a reference to a database table to a handle

Get Window_Handle Of oMyOkButton To hWnd  // moves a reference to a Window_Handle to a handle

Example

Handle hoButton

This example declares 1 handle variable named hoButton, which could be used to store the object handle for a button control.

 

Handle[] hoButtons

This example declares 1 dynamic array variable, named hoButtons, containing an undefined number of elements of type handle.

Handle[5] hoButtons

This example declares 1 static array variable, named hoButtons, containing 5 of elements of type handle.

Handle[][3] hoControls

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

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

Notes

 

Handle hoButton

Move myButton to hoButton