HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

JASS worse than me?

03-10-2005, 10:02 PM#1
Tabris
With a trigger I have

CONDITION mycondition

and this is translate in JASS by
if (not (mycondition)) then
return false
endif
return true

Why there is a not? I mean this is not better to not have the "not" and switch the "false" and "true"?

see also this thread please.
http://www.wc3campaigns.com/showthread.php?t=72604
03-10-2005, 11:06 PM#2
Zoxc
not do exist

function not takes boolexpr operand returns boolexpr
03-11-2005, 04:29 AM#3
masda70
I believe WE uses that syntax to make it easy when adding more conditions:

Code:
if (not (mycondition1)) then
return false
endif
if (not (mycondition2)) then
return false
endif
return true

Both mycondition2 and mycondition1 need to be true if you want to return true.

Similar to this we have:

Code:
if (mycondition1) then
return true
endif
if (mycondition2) then
return true
endif
return false

In this case both conditions need to be false to return false. So if we compare the function return to false instead of true the results will be the same. I guess this is just matter of standards.

Of course WE is just weird, because it could use this:

Code:
If mycondition1 and mycondition2 then
return true
end if
return false

Maybe it was easier to program a common "graphic look" that is very versatile in this kind of code situations.
03-11-2005, 04:17 PM#4
Tabris
ok! So were are agree that we don't have to follow blizard's exemple. I had thought it could be to have better speed (during game maybe...) but I didn't understand why. And yeah, this is to make thing easier/faster but only for the transaltion trigger to JASS.