visual3d:documentation:pipeline:pipeline_commands:for_each_and_end_for_each
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
visual3d:documentation:pipeline:pipeline_commands:for_each_and_end_for_each [2024/06/17 18:22] – created sgranger | visual3d:documentation:pipeline:pipeline_commands:for_each_and_end_for_each [2024/09/03 13:57] (current) – [Command Syntax] wikisysop | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | + | ====== For Each and End For Each ====== | |
- | + | ||
Executes pipeline commands multiple times for each item in a list of items. It is not identical with a "for loop" or "do loop" in a programming language because the items must be explicitly defined as ITEMS in the command. This has some powerful consequences because it means that you can " | Executes pipeline commands multiple times for each item in a list of items. It is not identical with a "for loop" or "do loop" in a programming language because the items must be explicitly defined as ITEMS in the command. This has some powerful consequences because it means that you can " | ||
- | ===== Command Syntax | + | ==== Command Syntax ==== |
- | **For_Each** | + | < |
+ | For_Each | ||
/ | / | ||
!/ | !/ | ||
/Items= ITEM1+ITEM2+ITEM3 | /Items= ITEM1+ITEM2+ITEM3 | ||
- | **;** | + | ; |
! Starting from the For_Each command and ending at the End_For_Each command | ! Starting from the For_Each command and ending at the End_For_Each command | ||
! the loop is repeated once for each item in the For_Each command at each | ! the loop is repeated once for each item in the For_Each command at each | ||
! loop INDEX is a pipeline command this is identified as ::INDEX in any other command | ! loop INDEX is a pipeline command this is identified as ::INDEX in any other command | ||
- | **End_For_Each** | + | |
+ | End_For_Each | ||
/ | / | ||
- | **;** | + | ; |
+ | </ | ||
As of version 5.02.17, a new parameter " | As of version 5.02.17, a new parameter " | ||
- | ===== Example: Compute the GLOBAL mean value of a signal for each of 3 tags ===== | + | ==== Example: Compute the GLOBAL mean value of a signal for each of 3 tags ==== |
This example computes the GLOBAL mean value of a signal for each of 3 tags (TAG1, TAG2, TAG3) and adds the TAG name to the GLOBAL signal names that are created. | This example computes the GLOBAL mean value of a signal for each of 3 tags (TAG1, TAG2, TAG3) and adds the TAG name to the GLOBAL signal names that are created. | ||
Line 54: | Line 57: | ||
</ | </ | ||
- | ===== Example: Implementing a while loop ===== | + | ==== Example: Implementing a while loop ==== |
Visual3D doesn' | Visual3D doesn' | ||
+ | < | ||
Variable blnContinue = true | Variable blnContinue = true | ||
- | **While** Continue = true | + | While Continue = true |
Prompt user for variable blnContinue (true or false) | Prompt user for variable blnContinue (true or false) | ||
FileCounter = FileCounter +1 | FileCounter = FileCounter +1 | ||
[load and process another file (e.g. filename_filecounter)] | [load and process another file (e.g. filename_filecounter)] | ||
- | **End while** | + | End while |
- | ===== Example: Processing many files ===== | + | </ |
+ | ==== Example: Processing many files ==== | ||
First create a pipeline parameter that contains all of the filenames selected (e.g. all files that have the same TAG) concatenated into a string. | First create a pipeline parameter that contains all of the filenames selected (e.g. all files that have the same TAG) concatenated into a string. | ||
Line 92: | Line 97: | ||
! **NOTE:** Filenames do not have to be in any sequence or have any special naming convention. | ! **NOTE:** Filenames do not have to be in any sequence or have any special naming convention. | ||
- | ===== Exporting multiple files ===== | + | ==== Exporting multiple files ==== |
Using [[# | Using [[# | ||
Line 99: | Line 104: | ||
[[Visual3D: | [[Visual3D: | ||
- | |||
- | |||
visual3d/documentation/pipeline/pipeline_commands/for_each_and_end_for_each.1718648529.txt.gz · Last modified: 2024/06/17 18:22 by sgranger