See Also: Declaring Variables, Variable Declaration Commands, Struct, Integer
Declares one or more Handle variables.
Handle {identifier} […{identifier}]
Where
Where {identifier} is a variable name for the new handle variable.
{identifier} may be between 1 and 4096 characters in length, must start with a letter, and may not contain spaces. Recommended characters are 0-9, a-z, A-Z and _ (underscore).
To declare array variables of type Handle
Handle{dimension-list} {identifier} […{identifier}]
Where
{dimension-list} is a list of one or more array dimensions for the array. A dimension list is declared using square brackets []. One pair of brackets is used to declare each dimension. If the array is static, then you must specify the static size of each dimension between each pair of brackets. i.e. [{size}]. For more information about declaring arrays refer to Array Variable Assignments.
{identifier} may be between 1 and 4096 characters in length, must start with a letter, and may not contain spaces. Recommended characters are 0-9, a-z, A-Z and _ (underscore).
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.
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
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.
Use the Move command to initialize the value of a handle. For example;
Handle hoButton
Move myButton to hoButton
Using global variables is discouraged. The maximum number of global integers you can declare is 65640, which are used for classes (1 global integer is used for each class) and global integers. Some of these are already used for internal global integers.
If you need to define a global Handle variable, you should use the global_variable command to do so.