Version 4.2.6 for Mainframes (Update)
 —  Statements  —

Handle Definition

The handle-definition used with DEFINE DATA LOCAL, DEFINE DATA OBJECT, DEFINE DATA PARAMETER, DEFINE DATA INDEPENDENT and DEFINE DATA CONTEXT has the following syntax:

handle-name

HANDLE OF  OBJECT

CONSTANT

init-definition

     

INIT
 
(array-definitionHANDLE OF

OBJECT ../graphics/cbc2.gif ../graphics/sbo2.gif../graphics/cbo2.gif CONSTANT

array-init-definition

INIT

This document covers the following topics:

For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.


Function

A handle identifies a dialog element in code and is stored in handle variables. For further information, see the section NaturalX in the Programming Guide.

The HANDLE definition in the DEFINE DATA statement is generated automatically on the creation of a dialog element or dialog.

After having defined a handle, you can use the handle-name in any statement to query, set or modify attribute values for the defined dialog-element-type.

Examples of handle-definition:

1 #SAVEAS-MENUITEM HANDLE OF MENUITEM
1 #OK-BUTTON (1:10) HANDLE OF PUSHBUTTON

Top of page

Syntax Description

handle-name The name to be assigned to the handle; the naming conventions for user-defined variables apply; see Naming Conventions for User-Defined Variables in the Using Natural documentation.
HANDLE OF OBJECT Is used in conjunction with NaturalX as described in the section NaturalX in the Programming Guide.
CONSTANT

The variable/array is to be treated as a named constant. The constant value(s) assigned will be used each time the variable/array is referenced. The value(s) assigned cannot be modified during program execution.

Notes:

  1. For reasons of internal handling, it is not allowed to mix variable definitions and constant definitions within one group definition; that is, a group may contain either variables only or constants only.
  2. The CONSTANT clause must not be used with DEFINE DATA INDEPENDENT and DEFINE DATA CONTEXT.
INIT

The variable/array is to be assigned an initial value. This value will also be used when this variable/array is referenced in a RESET INITIAL statement.

Note:
With DEFINE DATA INDEPENDENT and DEFINE DATA CONTEXT, the INIT clause is evaluated in each executed programming object that contains this clause (not only in the programming object that allocates the variable). This is different to the way the INIT works for global variables.

init-definition With the init-definition option, you define the initial/constant values for a variable. See Initial-Value Definition.
array-definition With an array-definition, you define the lower and upper bounds of dimensions in an array-definition. See Array Dimension Definition.
array-init-definition The array is to be assigned an initial value. This value will also be used when this array is referenced in a RESET INITIAL statement.

Top of page