Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CAPL- Get value of string defined sysvar

i defined a sysvar as a string in CANalyzer to use it with a panel. Then in a CAPL a would like to get the value of this variable and save the name,i tried as i usually do in CAPL with the numbers so: write("%s",@namespace::name_of_variable) But i got an error saying tha the '@' should be used only for integer or float variables. How can i get the value of this string and save it in a local variable to reused it in a CAPL? Thanks in advice.

like image 523
Jordan.M Avatar asked Oct 15 '25 18:10

Jordan.M


1 Answers

The CAPL function you are looking for is sysGetVariableString

Usage is as follows:

char value[100]; //has to be big enough to hold the value

sysGetVariableString(sysvar::namespace::name_of_variable, value, elcount(value));
like image 118
M. Spiller Avatar answered Oct 17 '25 06:10

M. Spiller



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!