| iMatix home page
| Libero home page | Libero documentation
| << | < | > | >>
Libero Libero
Version 2.32

Using The Defaults State

You can define a single Defaults state in any dialog. You use this state to simplify dialogs. Often, the same event can happen in many states, with the same effect. Typically, you want to handle a fatal error at any point by displaying a message and halting the program.

Rather than repeating the event and its (identical) actions in every state where the fatal error may happen, place it in Defaults. If the event ever happens, Libero looks in the current state first. If it cannot find the event there it looks in the Defaults state. The Defaults state is ideal for error exception events that require central handling.

After processing the actions for the event, the dialog sets the next state as follows: if the specified next state is empty, it returns to the original state. If some next state is specified, it goes to that state.

When you use a Defaults state, the generated code for your dialog does not get smaller. It will actually get a little larger. But your dialog source code can usually be simplified, and this is always a good idea.


| << | < | > | >>
| Using Libero | The Dialog File Syntax | Libero Options | Using Exceptions | Using The Defaults State | Using Sub-Dialogs | Using Super-States | Using Templates | Using Get-External-Event | Efficiency | Care and Feeding of Dialogs | When To Use Libero
iMatix
Copyright © 1996-97 iMatix