|
| 23 Aug 2012 12:04 PM |
Currently, we have the <, >, <= and >= operators. We can check if a value is smaller than another value, bigger than another value, smaller or equal than/to another value, or bigger or equal than/to another value. However, we don't have an operator that allows us to check if a value is smaller or bigger than another value. For this reason, I suggest that we add the >< operator. It would return true if a value is smaller than another value and it would return true if the value is smaller than the other value.
There is currently obviously no way to do this, as we do not have a bigger or smaller than operator. Of course, we can do it by using two if statements, but that makes the code less readable and it is harder to use. |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 23 Aug 2012 12:05 PM |
| Or we could just use the ~= operator like normal people do. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 23 Aug 2012 12:06 PM |
Mhm?
if x < 0 and x > 10 then |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 12:07 PM |
@Legend26
I'm not trying to check if a value is different from another value, I'm trying to check if it is bigger or smaller than that other value! You don't understand, you must be a bad scripter. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 12:08 PM |
@TheMyrco
That won't work, you can only have one conditional expression in an if statement. You need two if statements to do that. Btw, there is no such thing as 'and' in Lua. |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 23 Aug 2012 12:09 PM |
I know what you're trying to do but it's essentially a ~= operator if the types are the same.
I'm not a bad scripter, you're just an insane scripter. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 23 Aug 2012 12:09 PM |
| Oh, you are tlaking about Lua Lua....hurr. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 12:10 PM |
@Legend26
The ~= operator is to check if the value is different from the value, not to check if it is bigger or smaller than the other value. They're completely irrelevant. You must not understand what the ~= operator does. |
|
|
| Report Abuse |
|
|
BenBonez
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 19362 |
|
|
| 23 Aug 2012 12:11 PM |
no julien just no you can do this with ~= |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 12:12 PM |
| Oh my god, none of you understands anything of scripting! I'm not trying to check if a value is different from another value, I'm trying to check if it is smaller or bigger than that other value! |
|
|
| Report Abuse |
|
|
BAUER102
|
  |
| Joined: 03 Apr 2010 |
| Total Posts: 5936 |
|
|
| 23 Aug 2012 12:13 PM |
| Isn't the value different when it's bigger or smaller? |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Aug 2012 12:14 PM |
| Equality has nothing to do with superiority comparisons! I don't care whether the values are different or not, I just want to know if one of the values is bigger or smaller than the other! |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 23 Aug 2012 12:14 PM |
>Oh my god, none of you understands anything of scripting! LOL
>I'm not trying to check if a value is different from another value, I'm trying to check if it is smaller or bigger than that other value! Wich means that it would be inequal to it aka use ~= SOLUTION FOUND :D |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 12:15 PM |
@TheMyrco
A value being smaller or bigger than another has nothing to do with inequality!
@su8
I'm not spamming, dude, I'm suggesting something useful! |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 23 Aug 2012 12:16 PM |
| @Julien: Why don't you just use < or > then? '_' |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 12:17 PM |
@ Julien: yes, there is such a thing as and.
a and b is true only if a is truthly and b is truthly.
~This sig is false~ |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 23 Aug 2012 12:17 PM |
@Julien: >A value being smaller or bigger than another has nothing to do with inequality! LOL. If a value is bigger or smaller than another value, it means that they are not equal aka inequal! :DD |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 12:17 PM |
@TheMyrco
Because there is no such operator!
Try this:
if 5 < or > 6 then end
> unexpected symbol near 'or' |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 23 Aug 2012 12:18 PM |
| I find it hilarious that Julien is a better troll than trolls that actually try to be trolls. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2012 12:18 PM |
@Mathfreak231
What does "truthly" mean? I can't find that word in any dictionary! |
|
|
| Report Abuse |
|
|
| |
|
myrkos
|
  |
| Joined: 06 Sep 2010 |
| Total Posts: 8072 |
|
|
| 23 Aug 2012 12:19 PM |
| What's up, Julien? Is there ever a case when a number that doesn't equal another number isn't bigger or smaller than it, or vice versa? |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Aug 2012 12:19 PM |
@Legend26
In fact, I'm not trolling, it was just intended to be a joke, but it seems none of you was good enough to realize it. :P |
|
|
| Report Abuse |
|
|