ReadFileLines

 

Description

Read specified lines from a text file into an array of strings.

Syntax

int ReadFileLines( StringArray & saLines, LPCSTR lpcszFile, uint iNumLines = 0, uint iFirstLine = 0, uint iSkipLines = 0 )

Parameters

saLines
[output]Reference to a string array that will hold the lines
lpcszFile
[input]Name of file to read
iNumLines
[input]Number of lines to read into the string array. If 0 then all lines are read.
iFirstLine
[input]Zero based index of the first line to read into the string array.
iSkipLines
[input]Number of lines to skip after every one line read.

Return

Returns zero for success or non-zero to indicate error.

Examples

EX1

int ReadFileLines_ex1()
{
    StringArray saLines;
    int iError = ReadFileLines(saLines, "C:\\Origin80\\Origin.ini");
    return 0;
}

Remark

See Also

header to Include

origin.h

Reference