body (in flowtask)

The body keyword defines the body of the ruleflow.

Purpose

This keyword is used to define the body of a flow task in flowtask statements.

Context

Flow task definitions

Syntax

flowtask flowTaskName 
{
    body {ruleflow} 
};

Description

The flow task body defines a ruleflow. It is composed of task calls that are chained together through control statements. The control statements are:

sequence, if, switch, while (break and continue), fork, goto.

Example

flowtask main
{
   body =
   {
      while(!ending)
      {
         if (turn == Constants.Player1) ChooseMovePlayer1;
         else ChooseMovePlayer2;
         
         CheckMove;
         if (ending) break;
         
         UpdateDistance;
         ExpandObjects;
         DetectConnect4;
         if (ending) break;
         
         DetectGridFull;
         if (ending) break;
         ChangeTurn;
      }
      EndOfGame;
   }
};