4D v16.3

LISTBOX GET OBJECTS

Home

 
4D v16.3
LISTBOX GET OBJECTS

LISTBOX GET OBJECTS 


 

LISTBOX GET OBJECTS ( {* ;} object ; arrObjectNames ) 
Parameter Type   Description
Operator in If specified, object is an object name (string)
If omitted, object is a variable
object  Form object in Object name (if * is specified) or Variable (if * is omitted)
arrObjectNames  Text array in Names of sub-objects comprising list box (headers, columns, footers)

The LISTBOX GET OBJECTS command returns an array containing the names of each object making up the list box designated by the object and * parameters.

Passing the optional * parameter indicates that the object parameter is an object name (string). If you do not pass this parameter, it indicates that the the object parameter is a variable. In this case, you pass a variable reference instead of a string.

In arrObjectNames, you pass a text array that is automatically filled in by the command. Object names are returned in their display order, with the following sequence: 

nameCol1
headerNameCol1
footerNameCol1
nameCol2
headerNameCol2
footerNameCol2
...

The array returns the object names for all the columns (including column footers), regardless of whether or not they are visible. 

This command is useful in the context of the parsing of a form using the FORM LOAD, FORM GET OBJECTS and OBJECT Get type commands. You can use it, when needed, to obtain the names of list box sub-objects.

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
OBJECT Get type

 
PROPERTIES 

Product: 4D
Theme: List Box
Number: 1302

 
HISTORY 

Created: 4D v14

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)