okutil_sys_values

 

Description

Sets or gets the system variable's value

Syntax

int okutil_sys_values( LPCSTR varName, double * pValue = NULL, BOOL bGet = true )

Parameters

varName
[input] pointer to string to system variable name, without the '@' part
pValue
[input|output] pointer to a double for setting and getting values
bGet
[input] true to get and false to set

Return

if bGet = false, return 0 on failure or if variable not found, otherwise return 1
if bGet = true, when pValue is provided, return 1 if variable is found, 0 if not; if pass NULL for pValue, return receive value

Examples

void okutil_sys_values_ex(string strVar)
{
        double rVal;
        int nRet = okutil_sys_values(strVar, &rVal);
        if(!nRet)
                printf("@%s not found\n", strVar);
        else
        {
                string strMsg;
                strMsg.Format("Please input new value for @%s\n", strVar);
                double dd = InputBox(rVal, strMsg);
                nRet = okutil_sys_values(strVar, &dd, false);
                if(!nRet)
                        out_str("fail to set value");
                else
                        out_int("", okutil_sys_values(strVar) );
        }
}

Remark

See Also

LT_set_var
LT_get_var

header to Included

origin.h

Reference