Index    EarthC language


Local Variables

Local variables are defined as in C at the beginning of each function, command, state or event

examples:

state x
{
    int k;
  
unit uTarget;
    if (
k==9)
       
k=3;
    unit
uObject;    //illegal

command (int k) ....
{
    int k;//remember if you assign the same name to local variable and function parameter, function parameter won't be accessible