DoNothing

From WarCraft3

Jump to: navigation, search

Template:jass/Blizzard.j This article is part of the Blizzard.j article series.


Does nothing.



Reason for existence

This function only make sense in the GUI If / Then / Else action (note that this is different than If / Then / Else, Multiple Functions). The way the If / Then / Else action is written makes it impossible to leave one action empty, and instead you have to insert the Do Nothing action there.

Since TFT, there is the If / Then / Else, Multiple Functions that supports an empty else (or if) clause and the Do Nothing action is therefore redundant but is often used for readability or due to ignorance. Also, TFT allows GUI users to insert comments into their code. In places where DoNothing was formerly required (single line If /Then / Else actions), a comment can be inserted instead.

In Jass, DoNothing is easily avoidable. The only use for a DoNothing call would be if you want to use ExecuteFunc without crashing the thread (ExecuteFunc("DoNothing"))

Personal tools