parse_data_range_str

 

Description

Parse a range string to separate detail information items.

Syntax

BOOL parse_data_range_str( LPCSTR lpcszRangeString, LPSTR lpszBookName, LPSTR lpszSheetName, LPSTR lpszR1, LPSTR lpszC1, LPSTR lpszR2, LPSTR lpszC2 )

Parameters

lpcszRangeString
[input] The Range string which will be parsed
lpszBookName
[output] The datarange's book name.
lpszSheetName
[output] The data range's sheet name
lpszR1
[output] The range's begin row
lpszC1
[output] The range's begin column
lpszR2
[output] The range's end row
lpszC2
[output] THe range's end column

Return

True if success, else false

Examples

EX1

void parse_data_range_str_ex1()
{
        string strRange = "[Book1]Sheet1!$A:$B" ;
        string strSheet;
        string strCol1;
        string strCol2;
        string strR1;
        string strR2;
        
        string strBook;
        char szBook[MAXLINE];
        char szSheet[MAXLINE];
        char szCol1[MAXLINE];
        char szCol2[MAXLINE];
        char szRow1[MAXLINE];
        char szRow2[MAXLINE];
        if(parse_data_range_str(strRange, szBook, szSheet, szRow1, szCol1, szRow2, szCol2))
        {
                strBook = szBook;
                strSheet = szSheet;
                strCol1 = szCol1;
                strCol2 = szCol2;
                strR1 = szRow1;
        strR2 = szRow2;
                printf("detail information items are :\n  strBook = %s\n strSheet = %s\n strCol1 = %s\n strCol2 = %s\n strR1 = %s\n strR2 = %s\n" 
                , strBook , strSheet , strCol1 , strCol2 , strR1 ,strR2 );
        }

}

Remark

See Also

header to Include

origin.h

Reference