2.2.4.46.21 Worksheet::ExportASCII

Description

Export worksheet to an ASCII file

Syntax

int ExportASCII( LPCSTR lpcszFilename, DWORD dwCntrl, char cSeparator = '\t', int nR1 = 0, int nC1 = 0, int nR2 = -1, int nC2 = -1 )

Parameters

lpcszFilename
[input] Full path file name
dwCntrl
[input] Options defined in OC_Const.h : WKS_EXPORT_HEADING, etc.
cSeparator
[input] Separator in the data file. The default value is "\t".
nR1
[input] First row in the data range to be included with the data file.
its default = 0.
nC1
[input] First column in the data range to be included with the data file.
its default = 0.
nR2
[input] Last row in the data range to be included with the data file. If < 0, indicate the last row in the worksheet.
its default = -1.
nC2
[input] Last column in the data range to be included with the data file. If < 0, indicate the last row in the worksheet.
its default = -1.

Return

On error, returns -1, otherwise returns the exported file size.

Examples

EX1

// Worksheet with data should be the active window
int Worksheet_ExportASCII_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        string strFile = GetSaveAsBox("*.dat");
        return wks.ExportASCII(strFile, WKS_EXPORT_ALL);
    }
    else
        return -99;
}

Remark

Export worksheet to an ASCII file

See Also

Header to Include

origin.h