FileGetRow Function

Action

Sets the current row pointer to the row number specified. After the current row pointer is set with FileGetRow you can access the columns of the row with the FileGetCol function.

Include file

Kernel.bdh

Syntax

FileGetRow(in hFile : number,
             in nRow  : number): number;

Return value

Row number of the current row (beginning with 1 for the first row of a file). If an invalid row number is specified, this function returns 0 and does not modify the row pointer.

Parameter Description
hFile Specifies the file handle that is used to access the file
nRow Row number to be set

Example

dcltrans
  transaction TMain
  const
    MAX_LEN := 254;
  var
    hFile, i : number;
    sColumn : string;
  begin
    ...
    FileFixedLoad(hFile, "login.csv", "1..20;21-40");
    for i := 1 to 100 do
      FileGetRow(hFile, i);
      sColumn := FileGetCol(hFile, 1, MAX_LEN);
    end;
    ...
  end TMain;