Layer::LT_set_var

Description

Set LabTalk variable value with a specific layer as the active layer.

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

//set the graph layer's height.
void   Layer_LT_set_var_ex1()
{
        double vv;
        GraphPage gp;
        gp.Create("Origin");
        GraphLayer gl = gp.Layers(0);
        gl.LT_get_var("layer.height", &vv);
        out_double("layer's height is ", vv);
        vv += 10;
        // Set the new value:
        if(gp.LT_set_var("layer.height", vv))
        out_str("set layer's height in LabTalk succeeded");
    else
        out_str("set layer's height in LabTalk failed");
 
    gp.LT_get_var("layer.height", &vv);
    out_double("new value is ", vv);
}

Remark

It sets the value of a LabTalk variable. The Layer Object is only temporarily set as the active layer. The Layer that was active before the code executes is restored as active upon return.

See Also

Layer-LT_get_var

header to Include

origin.h

Reference