• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[JASS] Do Elseifs work?

Status
Not open for further replies.
I just have a quick, simple question:

Do elseifs work?

Such as if I were to do something like this:
JASS:
function popoo takes nothing returns boolean
    if (GetUnitAbilityLevel(GetTriggerUnit(),'A000') == 1 then
    elseif IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD) then
    endif
    return false
endfunction

Note: This is just a quick example weird JASS thingy, please don't comment on how stupid it is or how to optimize it, I just want the answer to the question :emote_grin:

Will both "ifs" apply?

Any help is appreciated and rep might be given to those who help. :emote_smile:
 
I'm not really sure but yes, ifs apply both in the endif function (or somethin like that) but don't accuse me if something bad happens. (because I'm too stoopid* to understand JASS scripting)

Remember, I'm not sure. I don't even know how to create JASS scipts but I can understand O.o
 
Yes, it will work. I use it extensively. If the first condition returns false, it goes to the next elseif. If that returns false, it goes to the next elseif, and so on. It's basically like putting an If/Then/Else structure within the else of the first if, but it looks much more nicer.

Now if only I could use case structures...
 
Status
Not open for further replies.
Back
Top