Sfairadora

  • Reference Guide

Disp-switch

The disp-switch dispel allows you to change dynamically the contents of your presentation according to the values of edited data. The value that controls the switching of the presentation can be either directly present in the document data, or it can be a local variable (see the data provider, or it can be specified by an expression. The retrieved value determines a particular presentation instance from a predefined list. In this respect, the disp-switch is an analogy to if or switch statements in programming languages.
Furthermore, the value determining the presentation appearance may directly contain the dispel definition object. In this case the presentation changes dynamically, reflecting the value changes in the respective definition object. A simplified variant of this functionality is the indirect dispel.

Functionality

Item
Description
Value source
Determines how the value that controls the switching of the presentation is retrieved:
data value
the value is retrieved from a data item specified below.
data type
the value is the current type of the data item specified below.
function
the value is computed by evaluating the function specified below.
Object name
For Value source set to “data value” or “data type”:
Name of the object where the data item determining the presentation is located. You can select one of the objects provided by parent dispels.
Data reference
For Value source set to “data value” or “data type”:
Reference to a data item within the above identified object.
Presentation selection function
For Value source set to “function”:
Function in the Enki language returning the value determining the presentation.
Obtaining presentation
Determines how the presentation is obtained from the above defined value:
from presentation list
the presentation corresponding to the value is looked up in a predefined table (see the presentation list below).
value is a dispel definition
the value is interpreted directly as a dispel definition object.
If Value source is set to “data type”, this option is not present – the presentation can be obtained only from presentation list.
Maximum recursion depth
If the value is a dispel definition option is selected, and the current definition object contains another disp-switch referring to the same definition object, an infinite recursion might occur. Therefore, you can use this field to specify the maximum number of nested disp-switches with the same definition object; when the number is exceeded, no more disp-switches are created.
If you do not provide any value, the default of 20 is used.
Presentation list
Uniform value type
If you specify a type, all values in the presentation list will be of this type. If no type is specified (the not specified (none) option), you can select the type individually for every item in the list.
table of values and dispels
Table linking values to their respective dispels. The first column contains the values; the second column contains the dispel editor defining the respective presentation.
Default presentation
The dispel displayed when the value is not found in the list. If not defined, and the retrieved value is not in the list, nothing is displayed.
Definition type: Disp_switch_def