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

Home

 
4D v19.8
entitySelection.copy( )

entitySelection.copy( ) 


 

entitySelection.copy ( {option} ) -> Result 
Parameter Type   Description
option  Longint in ck shared: return a shareable entity selection
Result  EntitySelection in Copy of the entity selection

The entitySelection.copy( ) function returns a copy of the original entity selection.

Note: This function does not modify the original entity selection.

By default, if the option parameter is omitted, the function returns a new, non-shareable entity selection (even if the function is applied to a shareable entity selection). Pass the ck shared constant in the option parameter if you want to create a shareable entity selection.

Note: For information on the shareable property of entity selections, please refer to the Shareable vs Alterable entity selections paragraph. 

Example  

You create a new, empty entity selection of products when the form is loaded:

 Case of
    :(Form event code=On Load)
       Form.products:=ds.Products.newSelection()
 End case

Then this entity selection is updated with products and you want to share the products between several processes. You copy the Form.products entity selection as a shareable one:

 ...
  // The Form.products entity selection is updated
 Form.products.add(Form.selectedProduct)
 
 Use(Storage)
    If(Storage.products=Null)
       Storage.products:=New shared object()
    End if
 
    Use(Storage.products)
       Storage.products:=Form.products.copy(ck shared)
    End use
 End use



See also 

OB Copy

 
PROPERTIES 

Product: 4D
Theme: ORDA - EntitySelection
Number: 905278

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v18 R5

 
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)