4D v19

dataClass.newSelection( )

Home

 
4D v19
dataClass.newSelection( )

dataClass.newSelection( )  


 

The dataClass.newSelection( ) method creates a new, blank, alterable entity selection, related to the dataclass, in memory.

Note: For more information, see Shareable vs Alterable entity selections

If you want to create an ordered entity selection, pass the dk keep ordered selector in the keepOrder parameter. By default if you omit this parameter, or if you pass the dk non ordered selector, the method creates an unordered entity selection. Unordered entity selections are faster but you cannot rely on entity positions. For more information, please refer to the Ordered vs Unordered entity selections paragraph in the 4D Design Reference.

When created, the entity selection does not contain any entities (mySelection.length returns 0). This method lets you build entity selections gradually by making subsequent calls to the add( ) method.

Example  

 C_OBJECT($USelection;$OSelection)
 $USelection:=ds.Employee.newSelection() //create an unordered empty entity selection
 $OSelection:=ds.Employee.newSelection(dk keep ordered//create an ordered empty entity selection



See also 

dataClass.query( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - DataClass

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)