|
|
|
|
- Declaring the combinations
- Enabling or disabling the options of a combination
- Reading the combination options
- Passing a combination as a parameter to a procedure
- Assisted input
- Extension of combination
- Preset combinations
- Mutual exclusions
- Associated properties
- Available WLanguage functions
- Limits
Combination (Variable type)
A combination is a set of options. A combination variable or a combination parameter can be assigned with none, one or more combination options.
TypeCombinaison is Combinaison
CréationFic
LectureFic
EcritureFic
SuppressionFic
END
ActionFichier is TypeCombinaison
ActionFichier = LectureFic + EcritureFic
...
IF ActionFichier[EcritureFic] THEN
ELSE
END
Sintaxis
Declare a combination Ocultar los detalles
<Combination name> is Combination <Combination options> END
<Combination name>: Name of combination to declare <Combination options>: Different options that can be taken by the combination. <END>: End of declaration. <Variable name>: Name of Combination variable to declare. <Combination name>: Name of combination that was declared beforehand. Observaciones Declaring the combinations A combination must be declared in: - The project initialization code in order to be used in all the processes of the project (code of project, code of windows, code of controls, procedures, etc.).
- The declaration code of global variables of a window in order to be used in all the processes of the window (code of window, code of controls found in the window, local procedures, etc.).
- The opening code of a report in order to be used in all the processes of the report (code of the report, code of controls found in the report, local procedures, etc.).
- The declaration code of a class in order to be used in the class.
- To access this combination from a method of the class, use the syntax "::<Combination name>".
- To access this combination from a code external to the class, use the syntax "<Class name>::<Combination name>".
- The declaration code of sets of procedures in order to be used in all the procedures of the set.
Remark: A combination is always global: - to a project,
- to a window,
- to a report,
- to a class.
Enabling or disabling the options of a combination Several syntaxes can be used to enable or disable the options of a combination. For example: - Declaring the combination used for the examples:
TypeCombinaison is Combinaison
CréationFic
LectureFic
EcritureFic
SuppressionFic
END
ActionFichier is TypeCombinaison
- Disabling all the options:
Syntax:
<Variable Combinaison> = 0 Example:
- Enabling one or more options:
Syntax:
<Variable Combinaison> = Option 1 <Variable Combinaison>[Option 1] = Vrai
<Variable Combinaison> = Option 1 + Option 2 <Variable Combinaison>[Option 1 + Option 2] = Vrai Examples:
ActionFichier = LectureFic
ActionFichier = LectureFic + EcritureFic
ActionFichier[LectureFic] = True
ActionFichier[LectureFic + EcritureFic] = True
- Disabling one or more options:
Syntax:
<Variable Combinaison>[Option 1] = Faux
<Variable Combinaison>[Option 1 + Option 2] = Faux Examples:
ActionFichier[LectureFic] = False
ActionFichier[LectureFic + EcritureFic] = False
Reading the combination options Several syntaxes can be used to find out the combination options. For example: - Declaring the combination
TypeCombinaison is Combinaison
CréationFic
LectureFic
EcritureFic
SuppressionFic
END
ActionFichier is TypeCombinaison
- Check whether all the options are disabled:
Syntax:
SI <Variable Combinaison> = 0 Examples:
IF ActionFichier = 0 THEN ...
- Check whether an option is enabled:
Syntax:
SI <Variable Combinaison> = Option 1 ... SI <Variable Combinaison>[Option 1] = Vrai ... Examples:
IF ActionFichier = LectureFic THEN ...
IF ActionFichier[LectureFic] = True THEN ...
- Check whether several options are enabled:
Syntax:
SI <Variable Combinaison> = Option 1 + Option 2 ALORS ... SI <Variable Combinaison>[Option 1 + Option 2] = Vrai ... Examples:
IF ActionFichier = LectureFic + EcritureFic THEN ...
IF ActionFichier[LectureFic + EcritureFic] = True THEN ...
- Check whether at least one option is enabled:
Syntax:
SI <Variable Combinaison>[Option 1] OU <Variable Combinaison>[Option 2] ALORS ... Examples:
IF ActionFichier[LectureFic] OR ActionFichier[EcritureFic] THEN ...
Passing a combination as a parameter to a procedure A Combination variable can be passed as a parameter to a procedure. To do so, use the following syntax: <Nom de la procédure>(<Nom de la variable de type Combinaison>) For example:
PROCEDURE TypeFichier(p is TypeCombinaison)
TypeFichier(LectureFic + EcritureFic)
TypeFichier(ActionFichier)
Assisted input The assisted input for a Combination parameter proposes the different combination options. Extension of combination A combination can extend the values of one or more other combinations by taking the options of this ones and by adding new options. The following syntax is used: <Nom de la combinaison> est une Combinaison [Combinaison de base] <Options supplémentaires de la combinaison> FIN where: - <Combination name>: Name of combination that was declared beforehand.
- Base Combination: Name of base combination to use.
- <Combination additional options>: Additional options that will be taken into account in the combination.
Example:
TypeCombinaison is Combinaison
CréationFic
LectureFic
EcritureFic
SuppressionFic
END
TypeCombinaisonAvancé is Combinaison
[TypeCombinaison]
AutresAttributs
END
Preset combinations Several options can be combined to force a preset combination. The combined options must belong to the combination (or to base combinations) The following syntax is used: <Nom de la combinaison> est une Combinaison <Option 1 de la combinaison> <Option 2 de la combinaison> <Option 3 de la combinaison> = <Option 1 de la combinaison> + <Option 2 de la combinaison> FIN Example:
TypeCombinaison is Combinaison
CréationFic
LectureFic
EcritureFic
SuppressionFic
Lecture_Ecriture_Fic = LectureFic + EcritureFic
END
Mutual exclusions You have the ability to describe mutual exclusions between the combination options. For example, a combination contains three options: Option1, Option2 and Option3. Option2 and Option3 are exclusive: - Option1 and Option2 can be active.
- Option1 and Option3 can be active.
- Option2 and Option3 cannot be enabled.
- Option1, Option2 and Option3 cannot be active.
The following syntax must be used: <Nom de la combinaison> est une Combinaison <Option 1 de la combinaison> <Option 2 de la combinaison> <Option 3 de la combinaison> // Exclusions <Option 2 de la combinaison> - <Option 3 de la combinaison> FIN Remark: By combining the extensions and the exclusions, you have the ability to get for the same options: - a parameter of a function that imposes an exclusion,
- a parameter of a function that imposes no exclusion or that imposes a different exclusion.
Associated properties The following properties are associated with the Combination variables: | | nom | Used to find out the name of a Combination variable. | Value | Used to find out the associated value of a Combination variable. |
Available WLanguage functions A combination can be stored in an HFSQL item or in another file format. Depending on your requirements, you can store the combination name ( nom) or value ( Value). The following WLanguage functions allow you to get the characteristics of a stored combination:
| | CombinationCheckName | Comprueba si una combinación de una o más opciones conocidas por sus nombres es válida. | CombinationFromName | Devuelve una combinación de una o más opciones conocidas por su nombre.. | CombinationFromValue | Devuelve una combinación de una o más opciones conocidas por sus valores de associated. |
Limits - Combinations are not available in dynamic compilation.
- Combinations cannot be used outside the project.
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|