| Reference > Rule Languages > ILOG Rule Language > IRL Keywords > body (in Function Task) |
body (in Function Task) |
PREVIOUS NEXT |
The keyword used to define a function task body. This keyword is used in the functiontask definition
functiontask functionTaskName
{
body
{
action1;
...
actionn;
}
};
The function task body is equivalent to an IRL function without arguments and whose return type is void. 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).
functiontask UpdateDistance
{
body =
{
int x = move.x;
int y = move.y;
for (var i = y + 1; i < 10; i++)
{
int p = grid.position(x,i);
if (p == null) break;
p.distance--;
update(p);
}
}
};
evaluate, for, functiontask, if, modify, retract, return, throw, try, update, while
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |