Navigation: Language Reference > 13 - Built-in Functions >====== REGET (re-get record) ====== | |
REGET( sequence, string )
REGET | Regets a specific record. |
sequence | The label of a VIEW, FILE, KEY, or INDEX declaration. |
string | The string returned by the POSITION procedure. |
The REGET re-reads a previously accessed record.
FILE Usage
REGET reads the record identified by the string returned by the POSITION procedure. The value contained in the string returned by the POSITION procedure, and its length, are dependent on the file driver.
VIEW Usage
REGET reads the VIEW record identified by the string returned by the POSITION(view) procedure. The value contained in the string returned by the POSITION procedure, and its length, are file driver dependent. If the VIEW contains JOIN structures, REGET retrieves the appropriate set of related records.
REGET re-loads all the VIEW component files' record buffers with complete records. It does not perform the relational “Project” operation. REGET(view) is explicitly designed to reset the record buffers to the appropriate records immediately prior to a CLOSE(view) statement. However, the processing sequence of the files must be reset with a SET or RESET statement.
Errors Posted:
35 | Record Not Found |
37 | File Not Open |
43 | Record Is Already Held |
78 | Invalid number of parameters (string parameter is too small) |
Example:
ViewOrder VIEW(Customer) !Declare VIEW structure
PROJECT(Cus:AcctNumber,Cus:Name)
JOIN(Hea:AcctKey,Cus:AcctNumber) !Join Header file
PROJECT(Hea:OrderNumber)
JOIN(Dtl:OrderKey,Hea:OrderNumber) !Join Detail file
PROJECT(Det:Item,Det:Quantity)
JOIN(Pro:ItemKey,Dtl:Item) !Join Product file
PROJECT(Pro:Description,Pro:Price)
END
END
END
END
RecordQue QUEUE,PRE(Que)
AcctNumber LIKE(Cus:AcctNumber)
Name LIKE(Cus:Name)
OrderNumber LIKE(Hea:OrderNumber)
Item LIKE(Det:Item)
Quantity LIKE(Det:Quantity)
Description LIKE(Pro:Description)
Price LIKE(Pro:Price)
SavPosition STRING(260)
END
CODE
OPEN(Customer,22h)
OPEN1)
END
ACCEPT
CASE ACCEPTED()
OF ?ListBox
GET(RecordQue,CHOICE())
REGET(ViewOrder,Que:SavPosition)!Reset the record buffers
CLOSE(ViewOrder) !and get the record again
FREE(RecordQue)
UpdateProc !Call Update Procedure
BREAK
END
END
See Also: