Navigation: ABC Library Reference > FileManager > FileManager Methods >====== Next (get next record in sequence) ====== | |
Next, PROC
The Next method gets the next record in sequence. The Next method handles any errors, except end of file, that occur while getting the record.
The TryNext method provides slightly different (manual) alternative for getting records in sequence.
Implementation:
If Next succeeds, it returns Level:Benign (declared in ABERROR.INC). If it ultimately fails, it returns the severity level of the last error it encountered while trying to get the next record. See Error Class for more information on severity levels.
Return Data Type: BYTE
Example:
PROGRAM
INCLUDE('ABFILE.INC') !declare FileManager class
Access:Client CLASS(FileManager) !derive Access:Client object
END
CODE
!program code
LOOP !loop through client file
CASE Access:Client.Next() !get next record in sequence
OF Level:Notify OROF Level:Fatal !if error occurred
POST(Event:CloseWindow) !shut down
BREAK
ELSE !otherwise
PRINT(Rpt:Detail) !print the record
END
END