Worksheet::SetScript

Description

Worksheet script setting

Syntax

void SetScript( LPCSTR lpcszScript, DWORD dwCntrl, LPCSTR lpcszRangeCheckChange = NULL )

Parameters

lpcszScript
[input] labtalk script to set
dwCntrl
[input] bits to control the usage of the script, see WKSC_CNTL_IMPORT etc in oc_const.h
lpcszRangeCheckChange
[input] optional range string that will trigger this script to run when data inside the range is modified

Return

void

Examples

EX1

//Set Worksheet script in the active worksheet. 
void Worksheet_SetScript_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    string strScript = "wksn$=%H;\r\nwin -T plot;\r\nplotxy [wksn$]1!(1,2);\r\n";
    DWORD dwCntrl = WKSC_CNTL_IMPORT | WKSC_CNTL_LT_MULTILINES;
    wks.SetScript(strScript, dwCntrl, "[Data1]1!1:5");
}

Remark

See Also

Worksheet::GetScript

header to Include

origin.h