This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19.8
dataClass.newSelection( )

dataClass.newSelection( ) 


 

dataClass.newSelection ( {keepOrder} ) -> Result 
Parameter Type   Description
keepOrder  Longint in dk keep ordered: creates an ordered entity selection,
dk non ordered: creates an unordered entity selection (default if omitted)
Result  EntitySelection in New blank entity selection related to the dataclass

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 

Created: 4D v17

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)