The wiki makes a handful of examples. The first two are:
[r: ne(1, 0)]
[r: ne(1, 1, 0)]
which return:
1
0
Now, I understand the first example: 1 is not equal to 0, so ne() checks true.
But the second one, why is it false? The first 1 is equal to the second 1, but neither of them is equal to 0, so the inequality should check true.
What am I missing?
How does ne() actually work?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: How does ne() actually work?
ne, not equal checks a list of consecutive numbers or strings. And if there are any 2 that are equal, then the whole thing is false.
So, 1,1,0 is 1 ne 1 - false.. doesn't need to check any more.
1, 0, 1 is 1 ne 0, true.. 0 ne 1, true so whole list is true.
so a list of a,b,c,d,e is: a ne b; b ne c, c ne d and d ne e.
So, 1,1,0 is 1 ne 1 - false.. doesn't need to check any more.
1, 0, 1 is 1 ne 0, true.. 0 ne 1, true so whole list is true.
so a list of a,b,c,d,e is: a ne b; b ne c, c ne d and d ne e.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
-
- Kobold
- Posts: 17
- Joined: Sat May 11, 2019 8:41 am
Re: How does ne() actually work?
Oh, ok, so it checks if there is any kind of repetition, not if there's inequality between the whole batch of parameters.
Thanks.
Thanks.
Re: How does ne() actually work?
updated wiki
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS