INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Expression Language function request: NOT  (Read 691 times)

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2361
Expression Language function request: NOT
« on: December 22, 2020, 05:24:18 pm »

Hi Matt,
Can you please add a Not() function? The exclamation mark only works inside an if(), and I suppose that's a fluke.
It's useful to negate Regex mode 0 which returns 0 or 1, for instance, and other bool functions.

Rules:
Not(0) = 1
Not(1) = 0
Not() = 1     (empty value or whitespace)
Not(anythingElse) = 0

Thanks, and happy holidays!
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Expression Language function request: NOT
« Reply #1 on: December 23, 2020, 10:28:11 pm »

I've struggled with this sort of thing occasionally too. This would be useful. +1
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Expression Language function request: NOT
« Reply #2 on: December 23, 2020, 10:42:33 pm »

I'll point out that this functionality does already exist in the Math() function, but it would be nice to have it independently, as we already do with And() and Or().
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41920
  • Shoes gone again!
Re: Expression Language function request: NOT
« Reply #3 on: December 24, 2020, 04:44:12 pm »

Good idea.  I'll see if I can knock it off when I'm back.

Thanks :)
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up