Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
for_each [2013/07/10 21:27]
admin
for_each [2026/08/28 03:20] (current)
hermann Sync from local documentation review
Line 1: Line 1:
-====== For Each ====== ​+====== For Each ======
  
 ===== Description ===== ===== Description =====
  
-This container ​executes the contained ​functors once per each element ​of a given lookup table. ​+Container that executes the functors ​it contains ​once for every entry of a given table or lookup table, making each entry'​s key available to its contents through the internal output port Step.
  
 ===== Inputs ===== ===== Inputs =====
  
-^ Name ^ Type ^ Description ^ +^ Name  ^ Type  ^ Description ​ 
-| Elements ​ | [[Lookup ​Table Type|Lookup Table]]  | lookup table given as input.  |+| Elements ​ | [[Base Table Type]] ​ | Table or lookup table whose entries the contained functors are executed for.  |
  
 ===== Optional Inputs ===== ===== Optional Inputs =====
 +
 +^ Name  ^ Type  ^ Description ​ ^ Default Value  ^
 +| Sequence Input  | [[None Type]] ​ | Ensures that the functor connected to this port finishes executing before this container starts. ​ | None  |
  
 ===== Outputs ===== ===== Outputs =====
 +
 +^ Name  ^ Type  ^ Description ​ ^
 +| Sequence Output ​ | [[None Type]] ​ | Connect this port to another container'​s Sequence Input to make this container finish executing before that other container starts. ​ |
  
 ===== Internal Outputs ===== ===== Internal Outputs =====
  
 ^ Name  ^ Type  ^ Description ​ ^ ^ Name  ^ Type  ^ Description ​ ^
-| Step  | [[Double ​Type|Double]]  | Current step.  |+| Step  | [[Real Value Type]] ​ | Key of the current element being processed.  |
  
 ===== Group ===== ===== Group =====
Line 23: Line 29:
 [[Functor List#​Control | Control]] [[Functor List#​Control | Control]]
  
-===== Notes ===== +===== Notes ===== 
 + 
 +Execution only takes place for entries whose key is greater than or equal to zero and whose associated value is non-zero; other entries in Elements are skipped. 
 + 
 +Execution for multiple keys may happen simultaneously when there is no dependency between them. 
 + 
 +When Elements can be empty and the results produced by the contained functors are used outside this container, use a junction functor (such as [[Table Junction]] or [[Lookup Table Junction]]) so a result is still available when this container executes zero times.
  
-Execution will only take place for keys equal to or greater than zero and with non-zero values.+This functor was previously known as "​ParallelForEach";​ that name is still accepted ​for backward compatibility ​with existing scripts.
  
-===== Internal Name ===== +===== Internal Name =====
  
 ForEach ForEach