This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
tutorials:tool_quick_reference_card [2019/02/28 22:14] marcus.williams [M] |
tutorials:tool_quick_reference_card [2020/09/08 16:12] (current) marcus.williams [TOOL commands] |
||
---|---|---|---|
Line 127: | Line 127: | ||
endif | endif | ||
</code> | </code> | ||
- | |||
- | |||
**menu()** syntax: | **menu()** syntax: | ||
Line 138: | Line 136: | ||
Example1: using variable strings, defaults and one choice only paramters | Example1: using variable strings, defaults and one choice only paramters | ||
<code> | <code> | ||
- | integer $numChoices = 3 | + | integer $numChoices = 3 |
- | boolean $choices[$numChoices] | + | boolean $choices[$numChoices] |
- | string $choiceStrs[$numChoices] | + | string $choiceStrs[$numChoices] |
- | + | ||
- | $choiceStrs[1] = "ON Ministry of Finance - low scenario" | + | $choiceStrs[1] = "ON Ministry of Finance - low scenario" |
- | $choiceStrs[2] = "ON Ministry of Finance - reference scenario" | + | $choiceStrs[2] = "ON Ministry of Finance - reference scenario" |
- | $choiceStrs[3] = "ON Ministry of Finance - high scenario" | + | $choiceStrs[3] = "ON Ministry of Finance - high scenario" |
- | + | ||
- | menu ("Which result do you you want to see? ", $numChoices, \ | + | menu ("Which result do you you want to see? ", $numChoices, \ |
- | $choiceStrs[], $choices[]; defaultChoice=1, oneChoice=true) | + | $choiceStrs[], $choices[]; defaultChoice=1, oneChoice=true) |
- | + | ||
- | if ($choices[1] == true) | + | |
- | say ($choiceStrs[1]) | + | |
- | ... | + | |
- | endif | + | |
- | if ($choices[2] == true) | + | |
- | say ($choiceStrs[2]) | + | |
- | ... | + | |
- | endif | + | |
- | if ($choices[3] == true) | + | |
- | say ($choiceStrs[3]) | + | |
- | ... | + | |
- | endif | + | |
- | etc. | + | if ($choices[1] == true) |
+ | say ($choiceStrs[1]) | ||
+ | ... | ||
+ | endif | ||
+ | if ($choices[2] == true) | ||
+ | say ($choiceStrs[2]) | ||
+ | ... | ||
+ | endif | ||
+ | if ($choices[3] == true) | ||
+ | say ($choiceStrs[3]) | ||
+ | ... | ||
+ | endif | ||
</code> | </code> | ||
**If-Else** syntax: | **If-Else** syntax: |