Verify Function


Verifies that an actual value matches an expected value.


Verify(aActual, aExpected[, sDesc])
Variable Description
aActual The value to verify. ANYTYPE.
aExpected The expected value. ANYTYPE.
sDesc Optional: A message describing the comparison. STRING.


Verify compares two values of any type, including NULL values. It raises an E_TYPE_MISMATCH if their types do not match, or an E_VERIFY exception if their types match but their values are not equal.

Use Verify to verify that a variable in a script has the value you expect.

If aExpected is not equal to aActual, the exception raised by Verify lists values of both aExpected and aActual in the order they appear when calling the Verify function. If the values are lists or records, the results file contains an icon that invokes the difference viewer to display the differences.

If you include sDesc, the error message is: Verify sDesc failed — got aActual, expected aExpected. Otherwise, the default error message is Verify failed — got aActual, expected aExpected.


// raises an exception if the window does not exist
Verify(TextEditor.Exists(), TRUE)
// checks the selected value in the text field
Verify(TextEditor.Document.GetSelText (), "59.62", "selected text")