// Sequential browse to display the name of all customers
i is int
FOR i = 1 _TO_ Customer.NbRec(hStateAll)
Customer.Read(i)
IF Customer.State() = hStateActive THEN
Info("Customer name: " + Customer.Name)
END
END
Syntax
<Result> = <Source>.Read([<Record number> [, <Options>]])
<Result>: Boolean
- True if the record was read,
- False if an error occurred (lock, end of data file, etc.): the record is not read. HError is used to identify the error.
<Source>: Type corresponding to the specified source
Name of HFSQL data file, view or query used.
<Record number>: Optional integer
Number of the record to read.If this parameter is not specified (or if it is equal to 0 or to the
hCurrentRecNum constant),
<Source>.Read handles the current record.
<Options>: Optional constant
Configures the lock set on the record read by <Source>.Read: | |
hLockNo | No lock (even if HStartLock was called): the record can be read or modified by another application during the reading. |
hLockWrite | Lock in write mode: the record currently read can be read by another application but it cannot be modified by another application. |
hLockReadWrite | Lock in read/write: the record currently read cannot be read or modified by another application. |
Remarks
Memos
The memos associated with the record can be automatically read (or not) when reading the record.
<Source>.SetMemo is used to customize this automatic read operation.
If the memos are supported, the associated text memos are read when the record is read. The binary memos are read only when they are explicitly used (
<Source>.ExtractMemo).
Various
The current record number is returned by
<Source>.RecNum. The first record found in the data file is record #1.