TableValidation.Context

Description

A class that represents a TableValidation Context. The context stores data that persists through the duration of a rule.

Properties

col Gets the column the value is in.
endCol Gets the last column of the range.
endRow Gets the last row of the range.
errorMessage Gets/sets the errorMessage.
isFirstCol returns a 1 if the column the value is in is the first column of the range.
isFirstRow returns a 1 if the row the value is in is the first row of the range.
isFirstValue returns a 1 if the value is the first value in the range.
isLastCol returns a 1 if the column the value is in is the last column of the range.
isLastRow returns a 1 if the row the value is in is the last row of the range.
isLastValue returns a 1 if the value is the last value in the range.
labels Accesses the context's labels as nodes.
row Gets the row the value is in.
startCol Gets the starting column of the range.
startRow Gets the starting row of the range.
table Gets table that is currently being validated.

Methods

addRegex Stores a regular expression by name in the context.
valueMatchesRegex Compares the value against a stored regular expression in the context.

Details

Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.col

readonly int col

Description

Gets the column the value is in.


					TableValidation.Context ctx = param(2);
					int column = ctx.col;
				
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.endCol

readonly int endCol

Description

Gets the last column of the range.


					TableValidation.Context ctx = param(2);
					int endColumn = ctx.endCol;
				
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.endRow

readonly int endRow

Description

Gets the last row of the range.


					TableValidation.Context ctx = param(2);
					int endRow = ctx.endRow;
				
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.errorMessage

string errorMessage

Description

Gets/sets the errorMessage.

The errorMessage is by default the Failure Message defined on the rule. It is what is displayed at the end of a logged error message.


				TableValidation.Context ctx = param(2);
				ctx.errorMessage = "The value was not an integer";
			
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.isFirstCol

readonly int isFirstCol

Description

returns a 1 if the column the value is in is the first column of the range.


					TableValidation.Context ctx = param(2);
					int isFirstCol = ctx.isFirstCol;
				
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.isFirstRow

readonly int isFirstRow

Description

returns a 1 if the row the value is in is the first row of the range.


					TableValidation.Context ctx = param(2);
					int isFirstRow = ctx.isFirstRow;
				
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.isFirstValue

readonly int isFirstValue

Description

returns a 1 if the value is the first value in the range.


					TableValidation.Context ctx = param(2);
					int isFirstValue = ctx.isFirstValue;
				
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.isLastCol

readonly int isLastCol

Description

returns a 1 if the column the value is in is the last column of the range.


					TableValidation.Context ctx = param(2);
					int isLastCol = ctx.isLastCol;
				
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.isLastRow

readonly int isLastRow

Description

returns a 1 if the row the value is in is the last row of the range.


					TableValidation.Context ctx = param(2);
					int isLastRow = ctx.isLastRow;
				
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.isLastValue

readonly int isLastValue

Description

returns a 1 if the value is the last value in the range.


				TableValidation.Context ctx = param(2);
				int isLastValue = ctx.isLastValue;
			
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.labels

readonly labels

Description

Accesses the context's labels as nodes.

Works just like labels on treenodes.

Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.row

readonly int row

Description

Gets the row the value is in.


				TableValidation.Context ctx = param(2);
				int column = ctx.col;
			
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.startCol

readonly int startCol

Description

Gets the starting column of the range.


				TableValidation.Context ctx = param(2);
				int column = ctx.col;
			
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.startRow

readonly int startRow

Description

Gets the starting row of the range.


				TableValidation.Context ctx = param(2);
				int column = ctx.col;
			
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.table

readonly Table table

Description

Gets table that is currently being validated.


				TableValidation.Context ctx = param(2);
				Table table = ctx.table;
			
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.addRegex()

void addRegex( RegExp pattern , string name )

Parameters

pattern The pattern of characters to look for, a regular expression.
name The name of the pattern.

Description

Stores a regular expression by name in the context.


				TableValidation.Context ctx = param(2);
				ctx.addRegex(/^[a-zA-Z]$/, "matchRegex");
			
Do no remove, this fixes the anchor on doc.flexsim.com

TableValidation.Context.valueMatchesRegex()

int valueMatchesRegex( Variant value , string regexName )

Parameters

value The value you are matching the regular expression to.
regexName the name of the regex stored on the context using addRegex.

Returns

int If it matched.

Description

Compares the value against a stored regular expression in the context.


				Variant value = param(1);
				TableValidation.Context ctx = param(2);
				ctx.valueMatchesRegex(value, "matchRegex");