Error Messages [Error]

If validation is performed when leaving a state, then there is a need to be able to issue an error message to the user and cancel the move to the next state. This function is provided by the WizardEngine's "Error" method.

The "Error" method takes one, two, or three parameters, being the first, second, and third lines of a 4BtnDialog. Calling "Error" will cause the dialog to be displayed and the state move cancelled.

Note: You must call "Error" before you call "ForceState".

An example is displayed below.

If Move;
[
    IfThen(Move == Forward && PickValid(Trig != 0, 1), 
      IfElse(PickValid(Username, "") == "", 
        Engine\Error("A username is required."); 
      { Else } 
        IfElse(PickValid(Password, "") == "", 
          Engine\Error("A password is required."); 
        { Else } 
          IfThen(!Valid(PasswordConfirm) || (Password != PasswordConfirm), 
            Engine\Error("Passwords do not match."); 
          ); 
      )); 
    ); 
    Move = 0; 
    ForceState(NextState); 
]