4D v16.3

FORM GET OBJECTS

Home

 
4D v16.3
FORM GET OBJECTS

FORM GET OBJECTS 


 

FORM GET OBJECTS ( objectsArray {; variablesArray {; pagesArray}} {; formPageOption | *} )  
Parameter Type   Description
objectsArray  String array in Name of form objects
variablesArray  Pointer array in Pointers to variables or fields associated with objects
pagesArray  Integer array in Page number of each object
formPageOption | *  Longint, Operator in 1=Form current page, 2=Form all pages, 4=Form inherited
If * passed (obsolete) = current page with inherited objects

The FORM GET OBJECTS command returns the list of all objects present in the current form in the form of (an) array(s). This list can be restricted to the current form page and can exclude objects of inherited forms. The command can be used with both input and output forms.

If an array passed as a parameter is not previously declared, the command creates it and automatically sets its size. However, in the interest of compiling the application, we recommend that you explicitly declare each array.

Pass the name of the string array that will contain object names (each object name is unique within a form) in objectsArray. The order in which objects appear in the array is not significant.

The other arrays optionally filled by the command are synchronized with the first array.

Pass the name of the pointer array that already contains pointers to variables or fields associated with objects in the optional variablesArray parameter. If an object does not have an associated variable, the pointer Nil is returned. If there is a “subform” type object, a pointer to the table of the subform is returned.

The third array (optional), pagesArray, is filled with the form page numbers. Each line of this array contains the page number of the corresponding object.

The optional * parameter allows you to reduce the list of objects returned to the current page of the form. When this parameter is passed, only objects of the current page, page 0 and inherited pages are returned by the command. In other words, all the objects present in the current page of the form (visible or not) are processed by the command.

The optional formPageOption parameter allows you to specify the form part(s) from where you want to get objects. By default, if the formPageOption parameter is omitted (as well as the * parameter), objects from all pages, including inherited objects, are returned. To reduce the scope of the command, you can pass a value in formPageOption. You can pass one (or a combination) of the following constants, found in the "Form Objects (Access)" theme:

Constant Type Value Comment
Form all pages Longint 2 Returns all objects of all the pages, excluding inherited objects
Form current page Longint 1 Returns all objects of the current page, including page 0 but excluding inherited objects
Form inherited Longint 4 Returns inherited objects only

Compatibility note: Passing the * parameter is equivalent to passing Form current page+Form inherited. The syntax using the * parameter is now deprecated and should no longer be used.

You want to get information on all pages including objects from the inherited form (if any):

  //open form
 FORM GET OBJECTS(objectsArray;variablesArray;pagesArray)

Or:

  //loaded form
 FORM LOAD([Table1];"MyForm")
 FORM GET OBJECTS(objectsArray;variablesArray;pagesArray;Form all pages+Form inherited)

You want to get information on the current page only, with page 0 of the loaded form and inherited form objects (if any):

 FORM LOAD("MyForm")
 FORM GOTO PAGE(2)
 FORM GET OBJECTS(objectsArray;variablesArray;pagesArray;Form current page+Form inherited)

You want to get information on all objects in the inherited form (if any). If there is no inherited form, arrays will be returned empty.

 FORM LOAD("MyForm")
 FORM GET OBJECTS(objectsArray;variablesArray;pagesArray;Form inherited)

You want to get information on page 4 objects, including page 0 objects, but without inherited form objects (if any):

 FORM LOAD([Table1];"MyForm")
 FORM GOTO PAGE(4)
 FORM GET OBJECTS(objectsArray;variablesArray;pagesArray;Form current page)

You want to get information on objects on all pages, but without inherited form objects (if any):

 FORM LOAD([Table1];"MyForm")
 FORM GET OBJECTS(objectsArray;variablesArray;pagesArray;Form all pages)



See also 

FORM GET PROPERTIES
Form Objects (Access)
Objects (Forms)

 
PROPERTIES 

Product: 4D
Theme: Forms
Number: 898

 
HISTORY 

Created: 4D 2004
Renamed: 4D v12
Modified: 4D v14 R2

 
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)