Sorry for all the questions today but I'm trying to move from harlowe to Sugarcube and I have so many questions. Okay. First:
In Harlowe I set a variable: $preference: "Blue" for instance.
{(if: $preference is "blue")[Awesome](if: $preference is "red")[Yup](if: $preference is "both")[sweet]}
!
Now. In Sugarcube I'm not sure that I can remove the whitespace(?) which is accomplished by the curly braces in Harlowe. If I can't, I will have to figure out another solution. As that would make the entire formatting in Sugarcube visually appalling. (How would I do such a thing?)
Next, the code I've written in sugarcube keeps kicking errors to me.
Error: cannot find a closing tag for macro <<if>>
<<if $preference is "men">>him
<<if $preference is "women">>her
<<if $preference is "both">>him<</if>
also tried
<<if $preference is "men">>him<</if>
<<if $preference is "women">>her<</if>
<<if $preference is "both">>him<</if>
Thanks for all your help.
#sigh
Comments
Use this in the passage where you call the widget
AFAIK, the braces remove line breaks, specifically, not whitespace in general. The equivalent construct in SugarCube would be the <<nobr>> macro. That said, SugarCube has several line break control mechanisms: line continuations, <<nobr>> macro, and nobr special tag.
In your first example:
You should be using <<elseif>> tags on the follow up cases anyway. Try something like:
That said, I'd probably suggest a <<switch>> macro in this case, since $preference is limited to a single state at a time:
NOTE: The backslashes are the line continuation markup. You could use one of the other line break control mechanisms instead if you prefer. All are linked above.