How can I react to event on system variable defined in CAPL script?

498 Views Asked by At

I defined a system variable in my CAPL file that I use to set up different modes in my script. I declared it in my CAPL file and not in my CANAlyzer window in order to allow the script to work with differents config.

sysDefineNamespace("NameSpace");

sysDefineVariableInt("NameSpace","VariableName",0);

The declaration has worked because I can change the value of this system variable with on key events.

The problem is with on sysvar events, the synthax that I saw on internet is not working. I use this one :

on sysvar NameSpace::VariableName{
  sysSetVariableInt("NameSpace","VariableName",0); //init tout à off
}

I have a compilation error :

Compiling...
  Options: CANalyzer, Realtime
Name (1, 11) Error 1249: Variable name 'NameSpace' not found
Compilation errors.

I'm pretty sure it is a synthax error but I didn't manage to fix it.

Thank you for your help !

I tried to change the synthax several time without success.

0

There are 0 best solutions below