body (in action task)

The body keyword defines the body of an action task.

Purpose

This keyword is used to define the body of an action task in functiontask statements.

Context

Function task definitions

Syntax

functiontask functionTaskName 
{
    body 
    {
       action1;
       ...
       actionn;
     }
};

Description

The action task body is equivalent to an IRL function with no arguments and with the void return type. The task execution consists in executing the statements that compose its body after its initial actions and before its final actions if they are defined.

Example

functiontask UpdateDistance
{
   body =
   {
      int x = move.x;
      int y = move.y;
      for (int i = y + 1; i < 10; i++)
      {
         int p = grid.position(x,i);
         if (p == null) break;
         p.distance--;
         update(p);
      }
   }
};