Tinderbox v9 Icon

Stream.failed()


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Stream parsing  [other Stream parsing operators]

 Baseline

 As at baseline


Stream.failed()

.failed tests for a failed Stream processing action Stream.try{}, including an explicit fail() call. It returns true if the current operation has failed, and false otherwise.

When processing a string, it may be that the string is not what was expected. Thus the .failed operator raises a flag to say this process did not work.

A .failed flag is reset to false when the current try{} expires, or when the current action is complete.

For example, to test if a 'try' sequence has failed:

	if ( $MyString.try{ … }.failed() ) {
		$Color="bright red";
	}