Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

array does NOT contain

Working on a project in Harlowe and have a question about arrays. Is there a way to build an "if" statement with an array that checks to see if the array does NOT contain an item? The opposite of "contain"?

I'm hoping that I just don't have a full syntactical understanding and such a thing exists: https://twine2.neocities.org/#type_array

The opposite of: (if: $bag contains "book")[do stuff]

Comments

  • The result of your $bag contains "book" conditional expression will be a Boolean data value of either true or false. In the documentation I linked to is a list of operators which can be used with boolean values, the one you need to use is not.

    That operator need to go before the conditional expression you want to effect, and you will need to delimit that expression with parenthesis.
    (if: not ($bag contains "book"))[do stuff]
    
Sign In or Register to comment.