FileGetFirstRow Function

Action

Sets the current row pointer to the first row in the file. After the current row pointer is set with FileGetFirstRow, you can access the columns of the row with the GetCol function. If the file is opened with a global FileLoad function (FileCSVLoadGlobal or FileFixedLoadGlobal), the current row pointer is set for all virtual users that access this file. Otherwise the current row pointer is set only for the virtual user calling the function.

Include file

Kernel.bdh

Syntax

FileGetFirstRow(in hFile: number): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hFile Specifies the file handle that is used to access the file

Example

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