Skip to content

Instantly share code, notes, and snippets.

@MarkGoldberg
Created November 27, 2013 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkGoldberg/7675892 to your computer and use it in GitHub Desktop.
Save MarkGoldberg/7675892 to your computer and use it in GitHub Desktop.
ViewManager.Next (Clarion ABC) refactoring for clarity This helps explain return values from .ValidateRecord() ViewManager.Next is One Method from ABBrowse.clw
ViewManager.Next PROCEDURE
CODE
LOOP
NEXT(SELF.View)
CASE ERRORCODE()
OF NoError ; CASE SELF.ValidateRecord()
OF Record:OK ; RETURN Level:Benign
OF Record:OutOfRange; RETURN Level:Notify
! OF Record:Filtered ; do nothing loop around for the NEXT()
END
OF BadRecErr; RETURN Level:Notify
ELSE ; SELF.Primary.Me.Throw(Msg:AbortReading)
RETURN Level:Fatal
END
END
!!Below is the shipping version
! ViewManager.Next PROCEDURE
! CODE
! LOOP
! NEXT(SELF.View)
! IF ERRORCODE()
! IF ERRORCODE() = BadRecErr
! RETURN Level:Notify
! ELSE
! SELF.Primary.Me.Throw(Msg:AbortReading)
! RETURN Level:Fatal
! END
! ELSE
! CASE SELF.ValidateRecord()
! OF Record:OK
! RETURN Level:Benign
! OF Record:OutOfRange
! RETURN Level:Notify
! END
! END
! END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment