0 votes
by (410 points)
closed by

This is a peculiar one, so I hope you can forgive me if I can't articulate it well.

 

I have a variable that gets set to strings, or names as it were, depending upon the events of the story. So, we'll say "A", "B", and so on.

 

Hence, when they are set, they are like so:

(set:$choice to "A")

 

My problem lies in that, when going through other passages, it checked this particular value, of which there are a variety of given strings.

 

My initial solution would have been to do this:

(if:$choice is "A")[Printed answer]
(elseif:$choice is "B")[Other Printed Answer]
(elseif:$choice is "C")[Other Printed Answer]

And so on and so on, until all possible avenues of $choice were exhausted, so that every option was addressed.

 

Though, as you can imagine, this is incredibly cluttered. I was looking through the Harlowe documentation to see if I could find a cleaner way to do it, but I've been left a bit stumped, and it's likely something I'm vastly overlooking.

 

To give clarification, in this instance, all other instances of $choice that aren't the value chosen all give the same answer. So, what I would have liked to do is some sort of if statement that checked if the value WASN'T a particular string instead of the other way around.

 

Is this possible?

closed with the note: The answer was in front of my eyes all along.

1 Answer

0 votes
by (410 points)
I'm an idiot. You can literally use "is not" and I overlooked it.

 

Sorry guys.
by (180 points)
:) You can also use (unless:)
...