User Tools

Site Tools


trynext_try_to_get_next_record_in_sequence_.htm
Navigation:  ABC Library Reference > FileManager > FileManager Methods >====== TryNext (try to get next record in sequence) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

TryNext, PROC

blk2blue.jpg

The TryNext method gets the next record in sequence. The TryNext method does not attempt to handle errors that occur while getting the next record.

The Next method provides a slightly different (automatic) alternative for getting records in sequence.

Implementation:

TryNext tries to get the next record. If it succeeds, it returns Level:Benign (declared in ABERROR.INC). If it fails, it returns the severity level of the error it encountered while trying to get the record. See Error Class for more information on severity levels.

Return Data Type:     BYTE

Example:

PROGRAM  BatchReport               !batch process–don't display errors

INCLUDE('ABFILE.INC')             !declare FileManager class

MAP                               !program map

END

GlobalErrors ErrorClass            !declare GlobalErrors object

Access:Client CLASS(FileManager)   !derive Access:Client object

      END

CODE

!program code

LOOP                              !loop through client file

 CASE Access:Cliet.TryNext()      !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

See Also:     Next , NEXT, GET

trynext_try_to_get_next_record_in_sequence_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1