2.1.15.6 LT_set_var


Description

Set LabTalk variable value

Syntax

BOOL LT_set_var( LPCSTR lpcszLabTalkVarName, double dbValue )

Parameters

lpcszLabTalkVarName
[input] LabTalk variable name, case insensitive
dbValue
[output] the new value

Return

TRUE if OK, and FALSE if it fails.

Examples

EX1

void    LT_set_var_ex1()
{
    double vv;
    if(LT_get_var("X", &vv))
    {
        vv += 10;
        // Set the new value:
        if(LT_set_var("X", vv))
            out_str("set X in LabTalk succeeded");
        else
            out_str("set X in LabTalk failed");
        
        LT_get_var("X", &vv);
        out_double("new value is ", vv);
    }
}

Remark

It sets the value of a LabTalk variable

See Also

LT_get_var

Header to Include

origin.h

Reference