Skip to content

End If ​

Category: Flow

A marker indicating the position where the branch processing of Conditional Branch ends. As the terminator of the branch block beginning from Conditional Branch, it must always be placed as a corresponding pair.

Always place as a pair with Conditional Branch

When using Conditional Branch, always place a corresponding instance of this event content. Structure:

Conditional Branch (Formula)
    (processing executed when true)
Else                 ← optional
    (processing executed when false)
End If (this event content)  ← required

Without this event content, an error occurs at editor save time. At runtime, if the corresponding End If is not found, a warning log is output and behavior becomes unclear.

Property List ​

This event content has no properties. It operates simply by being added to the event content list.

Runtime Behavior ​

This event content is a pure marker. At runtime, it does nothing and proceeds immediately to the next event content.

Its actual role is to be the target searched for as the corresponding terminator by Conditional Branch itself (when false) or by Else.

Behavior when reached ​

When this event content is reached through normal flow, it does nothing and proceeds to the next event content.

Role as a scan target ​

  • When Conditional Branch is false, it searches for this event content or Else, and jumps to immediately after whichever is found
  • When Else is executed (natural arrival after true-side execution completes), it searches for this event content and jumps to immediately after it

Nesting support ​

When Conditional Branch is nested, the correspondence between inner and outer is automatically determined correctly. Depth tracking prevents mistaking an inner End If for an outer one.

Typical Usage Flows ​

Flow 1: Basic if-else-endif ​

The most basic usage:

  1. Conditional Branch (Formula)
  2. (processing when true)
  3. Else
  4. (processing when false)
  5. End If (this event content) ← end of the branch block here

Flow 2: Else omitted ​

When processing only when the condition is satisfied:

  1. Conditional Branch (Formula)
  2. (processing only when true)
  3. End If (this event content)

Flow 3: Nested branches ​

When nesting Conditional Branches, nest this event content accordingly:

  1. Conditional Branch (condition A) ← outer
  2. Conditional Branch (condition B) ← inner
  3. (processing when A and B)
  4. End If (this event content) ← inner End If
  5. Else ← outer Else
  6. (processing when A is false)
  7. End If (this event content) ← outer End If

Displayed with indentation in the editor

In the editor display, this event content and Else are shown one level shallower. This visually clarifies which branch corresponds to which.

Flow 4: Multiple if-endif placed consecutively ​

If branches are independent, consecutive placement is fine:

  1. Conditional Branch (condition 1)
  2. (processing for condition 1)
  3. End If (this event content)
  4. Conditional Branch (condition 2)
  5. (processing for condition 2)
  6. End If (this event content)

Flow 5: Multi-stage branching in Else-if style ​

Place a next conditional branch inside Else:

  1. Conditional Branch (condition A)
  2. (processing for A)
  3. Else
  4. Conditional Branch (condition B)
  5. (processing for B)
  6. Else
  7. (processing when neither A nor B)
  8. End If (this event content) ← inner End If
  9. End If (this event content) ← outer End If

Typical Combinations ​

See Combination Pattern Collection for the overall picture.

Basic if-else-endif ​

The most basic branching structure:

  1. Conditional Branch
  2. (processing when true)
  3. Else
  4. (processing when false)
  5. End If (this event content)

Else omitted ​

When processing only when the condition is satisfied:

  1. Conditional Branch
  2. (processing only when true)
  3. End If (this event content)

Nested structure ​

Supports Conditional Branch nesting:

  1. Conditional Branch ← outer
  2. Conditional Branch ← inner
  3. (inner processing)
  4. End If (this event content) ← inner End If
  5. End If (this event content) ← outer End If
Related Event ContentPurpose
Conditional BranchPair of this event content (starting point of a branch, required pair)
ElseMarker for the false side of a Conditional Branch (optional, sandwiched between this event content)
PageRelated Content
Event Content ListList of all event contents

Notes ​

Always place as a pair with Conditional Branch ​

This event content is required in a set with Conditional Branch. Whenever you place a Conditional Branch, always place a corresponding instance of this event content.

Saving an event without a corresponding pair results in an error reported by the editor. At runtime, if the corresponding instance of this event content is not found, a warning log is output and processing silently proceeds to the next, so behavior may not match intent.

Does nothing at runtime ​

This event content is a pure marker. At runtime, it does nothing and proceeds immediately to the next event content. By the time it is reached, the branch block has ended, so everything thereafter is executed as common processing unrelated to the branch.

Nesting is possible ​

When Conditional Branch is nested, place this event content in a nested structure as well. The correspondence between inner and outer is automatically determined correctly (depth tracking prevents jumping to the wrong corresponding target).

One End If per Conditional Branch ​

For a single Conditional Branch, place only one instance of this event content. Placing two or more results in the second and later being treated as isolated markers (which may cause an error at save time).

Displayed with shallower indentation in the editor ​

In the editor display, this event content and Else are shown one level shallower than the processing inside the branch. This visually clarifies which Conditional Branch they correspond to.