clear( variable )


Parameters

  Type Description
variable lvalue variable to clear

_result

Not set.

Descriptions

Sets the root value of variable to 0 and removes all array and property elements.

The clear command may be used to reset user variables and also system variables that trigger events, store radio messages, and hold results: _cldrobot, _cldmissile, _cldcookie, _cldmine, _cldwall, _dtcrobot, _dtccookie, _dtcmine, _dtcwall, _ping, _radio, _radiocomm, and _result. This is helpful for robots that examine event triggers directly rather than registering event handlers. Once such a robot has handled an event it can reset the system variable manually by calling the clear command. Using clear with other system variables causes an error.

See Also

clearprops, cleararray, countarray, setarraycount, hasprop, countprops, getpropname, assignment (=), copy, initialize, isequal, user variables