- Joined
- Nov 25, 2008
- Messages
- 1,309
Why would someone use a constant variable (locally or globally) over having it be non-constant? Does it provide some speed gain? How do handles behave if they are constant?
I know that a constant variable can't be assigned to after being declared, but is that the only change? If this is the case, then why use
JASS:
globals
constant trigger T=CreateTrigger()
// Versus.
trigger T2=CreateTrigger()
endglobals
constant
at all? I'm curious as to how the Warcraft III engine reacts to constantness, not how some third-party tool uses it, or that 'you can't declare constant variables without vJASS'.