Howdy, Stranger!

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

Else If Problems

I'm working on a little project in Twine, using the 1.4.1 from the Twinery.org website on a Windows 8 machine, and I'm having a problem where every single <<elseif (expression)>> or <<else if (expression)>> is failing to function properly.  Whether it's something as simple as <<if $variable = 1>> <<elseif $variable = 2>> etc. or something slightly fancier such as <<if $variable < 5>> <<else if $variable > 4 and $variable < 10>> in all cases, I'm having the whatever is after the 1st elseif print out if the original if isn't true, apparently treating elseif as, well, just else.  I've tried both formations (elseif and else if) since both are supposed to work, but neither is, is there something I'm missing?

Comments

  • Are you using equals signs ("=") or "eq" in your formulations? Use "=" when setting variables and "eq" or "is" in your If thingeys. Get 'em mixed up and things won't work right.
  • Oh!  Well then, that'd probably do it then.  How does that work when checking if something is "Less than or equal to" something?  Can one still use <= then?
  • The other operators  like ">=" and "<=" work.

    It is just that "=" means assignment (like it does in a number of computer languages) and "==" means "is equal to"
  • Yeah, I really should've already known that, Twine was just sufficiently different in other ways that I forgot that very basic piece of programming know-how.  Thanks very much for the help, both of you.
Sign In or Register to comment.