| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== REGET (re-get record) ====== | [[rejectcode return reject code number .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[release release a held record .htm|{{btn_next_n.gif|Next page}}]] | | || **REGET(**// sequence, string //**)** {{blk2blue.jpg|blk2blue.jpg}} | **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** {{black.jpg|black.jpg}} 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** {{black.jpg|black.jpg}} 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)** ** OPEN((Header,22h)** ** OPEN(Detail,22h)** ** OPEN(Product,22h)** ** SET(Cus:AcctKey)** **  OPEN(ViewOrder)** ** LOOP                              !Read all records in file** **  NEXT(ViewOrder)                  !read a record sequentially** **  IF ERRORCODE() ** **   DO DisplayQue** **   BREAK** **  END** **  RecordQue :=: Cus:Record         !Move record into queue** **  RecordQue :=: Hea:Record         !Move record into queue** **  RecordQue :=: Dtl:Record         !Move record into queue** **  RecordQue :=: Pro:Record         !Move record into queue** **  SavPosition = POSITION(ViewOrder)!Save record position** **  ADD(RecordQue)                   !and add it** **  ASSERT(NOT ERRORCODE())** ** 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:** [[position return record sequence position .htm|POSITION]] [[set initiate sequential file processing .htm|SET]] [[reset reset record sequence position .htm|RESET]] [[watch automatic concurrency check .htm|WATCH]] [[get read a record or entry .htm|GET]] [[next read next record in sequence .htm|NEXT]] [[previous read previous view record in sequence .htm|PREVIOUS]]