Skip to main content
Version: 20 R7 BETA

OBJECT Get type

OBJECT Get type ( {* ;} object ) -> Function result

ParameterTypeDescription
*OperatorIf specified, object is an object name (string)
If omitted, object is a variable
objectanyObject name (if * is specified) or Variable (if * is omitted)
Function resultLongintType of object

This command is not thread-safe, it cannot be used in preemptive code.

Description

The OBJECT Get type command returns the type of the object designated by the object and * parameters in the current form.

Passing the optional * parameter indicates that the object parameter is an object name (string). This syntax is mandatory if you are processing static objects such as lines or rectangles.
If you do not pass this parameter, it indicates that the object parameter is a variable. In this case, you pass a variable reference instead of a string.

Note: If you apply this command to a set of objects, the type of the last object is returned.

The value returned corresponds to one of the following constants, available in the "Form Object Types" theme:

ConstantTypeValue
Object type 3D buttonLongint16
Object type 3D checkboxLongint26
Object type 3D radio buttonLongint23
Object type button gridLongint20
Object type checkboxLongint25
Object type comboboxLongint11
Object type dialLongint28
Object type groupLongint21
Object type groupboxLongint30
Object type hierarchical listLongint6
Object type hierarchical popup menuLongint13
Object type highlight buttonLongint17
Object type invisible buttonLongint18
Object type lineLongint32
Object type listboxLongint7
Object type listbox columnLongint9
Object type listbox footerLongint10
Object type listbox headerLongint8
Object type matrixLongint35
Object type ovalLongint34
Object type picture buttonLongint19
Object type picture inputLongint4
Object type picture popup menuLongint14
Object type picture radio buttonLongint24
Object type plugin areaLongint38
Object type popup dropdown listLongint12
Object type progress indicatorLongint27
Object type push buttonLongint15
Object type radio buttonLongint22
Object type radio button fieldLongint5
Object type rectangleLongint31
Object type rounded rectangleLongint33
Object type rulerLongint29
Object type splitterLongint36
Object type static pictureLongint2
Object type static textLongint1
Object type subformLongint39
Object type tab controlLongint37
Object type text inputLongint3
Object type unknownLongint0
Object type view pro areaLongint42
Object type web areaLongint40
Object type write pro areaLongint41

Example

You want to load a form and get a list of all the objects of list boxes that it contains.

 FORM LOAD("MyForm")
 ARRAY TEXT(arrObjects;0)
 FORM GET OBJECTS(arrObjects)
 ARRAY LONGINT(ar_type;Size of array(arrObjects))
 For($i;1;Size of array(arrObjects))
    ar_type{$i}:=OBJECT Get type(*;arrObjects{$i})
    If(ar_type{$i}=Object type listbox)
       ARRAY TEXT(arrLBObjects;0)
       LISTBOX GET OBJECTS(*;arrObjects{$i};arrLBObjects)
    End if
 End for
 FORM UNLOAD

See also

FORM LOAD
LISTBOX GET OBJECTS