Please use the Preformatted Text option when including code examples within a comment, doing so will stop the forum software converting valid standard single & double quotes into invalid Typographical (curly) single & double quotes. It also makes the code easier to read and to copy-n-paste into a test project for debugging.
If you look at the usage example of the
(prompt:) macro you will see that the macro returns a String value. eg. the
(prompt: String, String) → String line of the related documentation.
So if the end-user inputs a numerical value like 9 into the prompt field the String value returned by the macro will be
"9", so you need to change the conditional expressions of your
(if:) macros to test for String values. Also as each of your conditional expressions are mutually exclusive (eg. $followup can equal both 9 & 10) you should use an (else-if:) macro for the 2nd & last conditional expressions of that set.
(set: $followup to (prompt: "Enter your choice:", ""))
(if: $followup is "9")[(set: $now to 1)]
(else-if: $followup is "10")[(set: $now to 1)]
- You don’t need the parenthesis you had around your condition expressions.
- There should be no white space characters between a macro call and its associated hook.
- If the $now variable represents a true/false or yes/no or on/off type of boolean state then you should make it a Boolean variable. eg.
(set: $now to true) or
(set: $now to false). If you do change the variable to a Boolean then you would use conditional expressions like the following to test its current state.
(if: $now)[The variable current equals true]
(if: not $now)[The variable current equals false]
- The (show:) macro only reveals hidden hooks that are contain in the ‘current’ Passage, or Passages that are included into the ‘current’ Passage’s generated HTML contents.