05-31-2018, 12:04 PM
I tried try...catch block.
And saw strange work that block.
I have two flags: BlueFlag and VioletFlag, for example.
Distance between two flags about 100m.
My Bot moves between these flags.
When Energy is lower 0.8, message "Energy low" appears, but the Bot continues to moves to one of the flags,
and then moves to the PowerStation.
The goto(radar(xxxFlag).position) command is not interrupted
Why?
And saw strange work that block.
I have two flags: BlueFlag and VioletFlag, for example.
Distance between two flags about 100m.
My Bot moves between these flags.
Code:
extern void object::test()
{
try
{
while(true)
{
goto(radar(VioletFlag).position);
goto(radar(BlueFlag).position);
}
}
catch(energyCell.energyLevel < 0.8)
{
message("Energy low");
goto(radar(PowerStation).position);
}
}
When Energy is lower 0.8, message "Energy low" appears, but the Bot continues to moves to one of the flags,
and then moves to the PowerStation.
The goto(radar(xxxFlag).position) command is not interrupted
Why?