Method: Validate.FailItem( … )

Use to set a validation result of FailItem and error message in 1 line.
Will cause the entire input-row to be ignored and not included in the output. Will also produce an error message in the $LOG if input parameter fail is true. The value of fail will also be returned by the method, making it easier to write more compact and easier to read code.

Syntax

bool Validate.FailItem( bool fail, string failMessage )

Example

if( Validate.FailItem( !HasValue, "Cylinder requires a value" ) ) // return from script because nothing more to do + will add message to $LOG return; double val = Convert.ToDouble( Value ); Validate.FailItem( val > 8.0, "Cylinder value of '" + val + "' is out of range" ); // will add above messages to $LOG if it fails