Howdy, Stranger!

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

Quick If Conditional Branch Quesiton

Real quick question. I forget the correct syntax for an if conditional branch that is true for a range of numbers.

$foo = 7

<<if $foo = 6 or 7>>do stuff<<endif>>

I tried so many different ways. What's so frustrating is that I've done this before, but none of the code in which I figured it out exists any more.

Thanks!

Comments

  • Okay. Looks like I found it.

    <<set $foo = 2>>
    <<if $fool eq 1 or $foo eq 2>>Do stuff<<endif>>

    Of course, for that example, "lte 2" would be better, and lt/gte/etc. could be used in place of "eq" for a wider range of numbers.

    But, if there's a better way, I'm open to suggestions. :)
  • This sort of thing is outlined in the wiki.
  • You know, I don't think I've ever looked at the wiki before. I'll make sure and always check it. :)
Sign In or Register to comment.