Page::LT_set_str

Description

Set LabTalk string variable temporarily setting this page as the active page.

Syntax

BOOL LT_set_str( LPCSTR lpcszVar, LPCSTR lpcszContent )

Parameters

lpcszVar
[input] Origin string variables, %A through %Z, as well as LabTalk Object string properties
lpcszContent
[input] string content to be copied to Origin string variable, can be NULL to empty a string

Return

Return TRUE if success, return FALSE if string variable is not correctly specified or string is too long.

Examples

EX1

void Page_LT_set_str_ex1()
{
    char    szBuffer[200];
    WorksheetPage wksPage("Book1");    
        wksPage.LT_get_str("page.longname$", szBuffer, 200);
        //output the page's longname.
        out_str(szBuffer); 
        //set the page's longname as "MyBook".
        if(wksPage.LT_set_str("page.longname$", "MyBook"))
                out_str("set page's longname success");
        else
                out_str("set page's longname failed");
        wksPage.LT_get_str("page.longname$", szBuffer, 200);
        out_str(szBuffer);
}

Remark

Sets the value of a LabTalk global string variable or a LabTalk object string property, while the Page Object is temporarily active.

See Also

Page::LT_get_str

header to Include

origin.h

Reference