Worksheet::Type

Description

Dump the contents of the worksheet into the designated target window.

Syntax

BOOL Type( DWORD dwTarget, LPCTSTR lpcszNotesWindow = NULL, int numCols = 5, int nTab = 0, int nRepeatCol = 0, TreeNode & trRanges = NULL )

Parameters

dwTarget
[input] One or more combined bits from enum {
TYPETARGET_SCRIPT_WINDOW = 0x00000001UL, // to the Script window
TYPETARGET_NAMED_WINDOW = 0x00000002UL, // to the particular Notes window
TYPETARGET_OUTPUTLOG = 0x00000004UL, // to output log
TYPETARGET_SHOW_ERROR = 0x00000008UL, // show errors
};
Note: TYPETARGET_SHOW_ERROR is a constant which should be combined (bitwise "OR-ed") with other constants.
In the case it is combined with TYPETARGET_NAMED_WINDOW, it will report into Script Window (or other output)
when the Notes window with the supplid name does not exist.In other words, it is supposed to make the Type method
"report" method errors (same as type.wks() method of LabTalk works). If TYPETARGET_SHOW_ERROR is supplid alone,
nothing should happen.
lpcszNotesWindow
[input] The name of the notes window to receive the output. used only for TYPETARGET_NAMED_WINDOW. otherwise should
be NULL. default is NULL.
numCols
[input] The number of columns in one block. default is 5.
nTab
[input] Tab width (if 0, use worksheet column width as tab width). default is 0.
nRepeatCol
[input] The 1-offset index of the column which is to appear at the beginning of every block.
default is 0.
trRanges
[input]

Return

TRUE for success otherwise FALSE.

Examples

EX1

void Worksheet_Type_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return;
    
    Worksheet wks(wp.GetName());
    BOOL bRet = wks.Type(TYPETARGET_SCRIPT_WINDOW | TYPETARGET_OUTPUTLOG | TYPETARGET_SHOW_ERROR, "", 2, 0, 1);
    
    out_int("bRet = ", bRet);
}

Remark

See Also

header to Include

origin.h