Get LabTalk variable value
BOOL LT_get_var( LPCSTR lpcszLabTalkVarName, double * lpdbResult )
TRUE if lpcszLabTalkVarName is a LabTalk variable, and FALSE if it is not
EX1
void LT_get_var_ex1() { double vv; LT_get_var("X2", &vv); // get the current X axis right limit (the variable "X2") out_double("vv = ", vv); LT_get_var("@D",&vv); // get machine curremt date/time as Julian value (the system variable @D) out_double("vv = ", vv); if(LT_get_var("XYZ", &vv)) // try to get the value of the variable "XYZ" printf("in LabTalk, XYZ = %lf\n", vv); else out_str("XYZ is not a LabTalk variable"); }
You can use this command to get LabTalk variables, including system variables whose names begin with @.
This command is similar to LT_evaluate but you can tell if given name corresponds to a LabTalk variable even if its value is missing value, while LT_evaluate will not be able to differentiate. Also, using LT_evaluate to get value of a variable is slower.
LT_set_var
origin.h