Read_Row routine

Returns one or more rows from a table.

Read_Row(tablename, keylist, lockflag, readonlyflag)

The Read_Row routine has the following parameter.

ParameterDescription
tablenameThe name of the table that contains the row to read.
keylistA key or list of keys to read from tablename. The list should be an @fm-delimited list.
lockflagSpecifies whether or not the row is locked during the read operation. If null, no locking takes place. If a row is locked, it remains locked after the procedure is completed.

Lockflag - Description
0 - No locking takes place.
1 - Row is locked prior to read and remains locked.
readonlyflagSpecifies whether or not this row is read-only (not be updated). If true (1), the read request may be fulfilled from any cache or buffers maintained by the system. Otherwise, the row must be read from disk.

Returns the rows specified in keylist. If a single key is passed to the routine the results will be placed into the @RECORD system variable, as well as the SYSTEM RECEIVER. If multiple keys are passed to the routine, a SYSTEM RECEIVER must be implemented and the data will be returned to the RECEIVER. Data returned to the RECEIVER will contain tab-delimited field values and carriage return/line feed separated records.

Example Using System Monitor

* This command reads the customer records "1" and "2".

* This command is meant to be run form the SYSTEM MONITOR

run Read_Row "CUSTOMERS", [1, 2]

Example Using RECEIVER

* This will return the contents of keys 1 and 2 from the Customers table.


* Capture text results of Read_Row in the edit box EDITBOX_RESULTS.

Declare Function Get_Property
Declare Subroutine Set_Property, Read_Row

Set_Property ("SYSTEM", "RECEIVER", @window: ".EDITBOX_RESULTS")
Set_Property (@window: ".EDITBOX_RESULTS", "TEXT", "")
Read_Row("CUSTOMERS",1 : @fm : 2, "", "")

recordData = Get_Property (@window: ".EDITBOX_RESULTS", "TEXT")

swap TAB$ with @fm in recordData

swap CRLF$ with @rm in recordData

* reset the receiver property to null.
Set_Property ("SYSTEM", "RECEIVER", "")
  • guides/programming/programmers_reference_manual/read_row.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1