• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Or(...) vs or

Status
Not open for further replies.
Level 12
Joined
Mar 13, 2012
Messages
1,121
So, there is
JASS:
native Or         takes boolexpr operandA, boolexpr operandB returns boolexpr
and the keyword "or". Are there differences between these two?

Same applies for And(...) and "and".
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
And, Or, Not are very good if you have one(for not) or 2 boolexprs you want to execute back to back and dont want to suffer overhead from trigger creation and deletion. Other than that, they are useless garbage.

As PNF said, or, and and not work on booleans, so true, false, !=, ==, ... and Or, Not and And work on boolexprs, so basically on functions
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,156
If you can have boolexpr type global variables then you can use the natives for dynamic filters.

For example, you could apply filters from a boolexpr array with an accompanying size value. Filters could then be added, removed or re-ordered dynamically during a session.

Of course this could be done by evaluating the boolexprs into boolean variables and then using the appropriate in-built operators on them however those cannot be used as trigger conditions. As such the above native operators can be used to dynamically create trigger conditions (if JASS works as it should, which is often not the case).

Is it useful? Not really since the use case is probably very rare and can often be worked around about as efficiently.
 
Status
Not open for further replies.
Top