• 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.

[vJASS] Returns boolean -vs- nothing

Status
Not open for further replies.
Level 17
Joined
Feb 11, 2011
Messages
1,860
Hi guys,

I have seen many people make functions return a boolean for no reason. I seem to remember something about it being better, but I can't remember why. Could someone explain why it is preferred to return a boolean over return nothing. For example:

JASS:
private function KillAll takes nothing returns boolean
    for enumU in enumG
        call KillUnit(enumU)
    endfor
    
    return true
endfunction
Thanks,

Mr_Bean
 
Status
Not open for further replies.
Top