Navigation: ABC Library Reference > ViewManager > ViewManager Methods >====== ValidateRecord (validate an element) ====== | |
ValidateRecord, VIRTUAL
The ValidateRecord method validates the current VIEW element and returns a value indicating whether or not the data is valid. A return value of zero (0) indicates the item is valid; any other value indicates the item is invalid.
Implementation:
The ValidateRecord is a virtual placeholder for derived class methods.
The Next and Previous methods call the ValidateRecord method.
Return values are declared in ABFILE.INC as follows:
ITEMIZE(0),PRE(Record)
OK EQUATE !Record passes range and filter
OutOfRange EQUATE ! Record fails range test
Filtered EQUATE ! Record fails filter tests
END
Return Data Type: BYTE
Example:
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