list of boolean
papawo
Member, Developers Posts: 206 PRO
I want to export a list of boolean , similar to export enum but list of strings, where user can check 1 or more strings.
Can somebody point me to the right direction?
Can somebody point me to the right direction?
Tagged:
0
Best Answers
-
What do you mean by export?
In a feature dialog, several boolean parameters can be created in succession by simply defining several boolean parameters:annotation { "Name" : "My First Boolean" } definition.myBoolean1 is boolean; annotation { "Name" : "My Second Boolean" } definition.myBoolean2 is boolean; // ...
5 -
@papwo
An enum is a special variable type that is present in most programming languages which allows the programmer to define a mutually exclusive set of values which a variable can take. Here is an explanation for Java:
http://tutorials.jenkov.com/java/enums.html
So if you do something like this in FS:export enum NUMBER { ONE, TWO, THREE, FOUR } // Later, in a feature precondition definition.num is NUMBERyou are saying that definition.num must be one of those four values you defined earlier. When translating this into UI, the logical choice for us was to make this into a dropdown (or tabs if using the HORIZONTAL_ENUM UIHint).
If you instead wanted 4 checkboxes, there is no way you could pack those into one variable. There are 4 separate true/false values you're trying to keep track of. You would have to do something like:// In a feature precondition definition.one is boolean; definition.two is boolean; definition.three is boolean; definition.four is boolean;
You're welcome to pack these into a predicate if you want, but it doesn't really matter if they're in a predicate or just in the precondition itself.Jake Rosenfeld - Modeling Team5
Answers
-
What do you mean by export?
In a feature dialog, several boolean parameters can be created in succession by simply defining several boolean parameters:annotation { "Name" : "My First Boolean" } definition.myBoolean1 is boolean; annotation { "Name" : "My Second Boolean" } definition.myBoolean2 is boolean; // ...
5 -
I used export predicate List (definition is map) and it works now..I keep getting errors as Im using export enum List.0
-
@papwo
An enum is a special variable type that is present in most programming languages which allows the programmer to define a mutually exclusive set of values which a variable can take. Here is an explanation for Java:
http://tutorials.jenkov.com/java/enums.html
So if you do something like this in FS:export enum NUMBER { ONE, TWO, THREE, FOUR } // Later, in a feature precondition definition.num is NUMBERyou are saying that definition.num must be one of those four values you defined earlier. When translating this into UI, the logical choice for us was to make this into a dropdown (or tabs if using the HORIZONTAL_ENUM UIHint).
If you instead wanted 4 checkboxes, there is no way you could pack those into one variable. There are 4 separate true/false values you're trying to keep track of. You would have to do something like:// In a feature precondition definition.one is boolean; definition.two is boolean; definition.three is boolean; definition.four is boolean;
You're welcome to pack these into a predicate if you want, but it doesn't really matter if they're in a predicate or just in the precondition itself.Jake Rosenfeld - Modeling Team5 -
Thank you for the explanation !0
-
Check this...Java Interview Questions0


