FileGetRndRow Function

Action

Sets the current row pointer to a randomly selected row between the first row and the maximum rows of the file. After the current row pointer is set with FileGetRndRow you can access the columns of the row with the FileGetCol function.

Include file

Kernel.bdh

Syntax

FileGetRndRow(in hFile: number): number;

Return value

row number of the current row (beginning with 1 for the first row of a file)

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

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
      FileGetRndRow(hFile);
      sColumn := FileGetCol(hFile, 1, MAX_LEN);
    end;
    ...
  end TMain;