4D v18

dataClass.newSelection( )

Home

 
4D v18
dataClass.newSelection( )

dataClass.newSelection( )  


 

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

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 Developer Guide.

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 v18)