Control Flow

The contents of a Linx function is executed from top to bottom.

Default Control Flow

In Linx control flow statements are implemented as functions. The Linx plugin contains DoWhile, ForEach, IfElse and TryCatch. They work exactly like their programming counterparts.

ForEach loops through any list and exposes each item in an execution path. To try it:

  1. Create a list and call it Names.
  2. Drag a ForEach from the Linx plugin.
  3. Set the List property to Names (using the dropdown).

ForEach

The ForEach shows an execution path called Loop. This path will be executed once for each item in the List. To see it working:

  1. Add a couple of items to Names.
  2. Add the File plugin.
  3. Drag the TextFileWrite function into the box below Loop.
  4. Set the File path property.
  5. Set the Contents property to ForEach.Loop by selecting it from the dropdown.

ForEach Loop

Click DEBUG to run the Function and see the result.

DoWhile and IfElse use expressions to control the program flow. To try DoWhile:

  1. Add an Integer to the Function and name it Counter.
  2. Add a DoWhile and set its Condition property to Counter < 5. Use the Expression Editor in the dropdown to make this easier. DoWhile will keep on executing while the Condition is true.
  3. Add a SetValue to the Loop and set its properties to add 1 to Counter each time it executes.

DoWhile

Click DEBUG to run the Function and see the result.

Tutorial video



Previous | Next