Saltar para o conteúdo principal
Versão: 20 R7 BETA

OBJECT Get type

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

ParâmetroTipoDescrição
*OperadorSe especificado, objeto é um nome de objeto (cadeia) Se omitido, objeto é uma variável
objectanyNome de objeto (se especificado *) ou Variável (se omitido *)
ResultadoIntegerTipo de objeto

Esse comando não é seguro para thread e não pode ser usado em código adequado.

Descrição

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

Exemplo

Você quer carregar um formulário e obter a lista de todos os objetos dos list boxes que contém.

 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

Ver também

FORM LOAD
LISTBOX GET OBJECTS