Skip to content

How to enforce ranges or other data conditions? #214

Answered by csnover
JiveyGuy asked this question in Q&A
Discussion options

You must be logged in to vote

The assert directive validates objects and fields after they are read or before they are written, returning an error if the assertion condition evaluates to false. Any earlier field or import can be referenced by expressions in the directive.

For this specific case you would assert on #[br(assert((i..j).contains(field)))].

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JiveyGuy
Comment options

Answer selected by JiveyGuy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants