savevar

Navigation:  Programming language SQC > Built-in functions > Non volatile memory >

savevar

Previous pageReturn to chapter overviewNext page

The function savevar() saves the values and names of variables to the file system.

It returns a 0 for a successful operation, and nonzero otherwise

 

int savevar ( all address );

 

Example:

 

void main()

{

    int x = 0;

 

    loadvar(x);

    if(x == 0)

    {

      printf("Variable x not saved");

      x = 4711;

      savevar(x);

    }

    

    loadvar(x);

    printf("Variable x : %d",x);

    

    clearvar();

}

 

Output:

 

  Variable x not saved

  Variable x : 4711