Creation/Dev/GScript/Constants

From Graal Bible
Revision as of 15:37, 9 May 2006 by Tolnaftate2004 (talk | contribs) (Creation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

As one might be able to deduce, a constant has a single value and will retain that value as long as that constant exists. A constant is not a variable for one very important reason: it's value is not variable!

const intVar = 3;
intVar = 4;
player.chat = intVar; // displays 3

The value of the constant cannot change even in conjunction with the use of the "=" operator. This is the power of a constant. However, player.variables cannot be defined as a constant (client(r).variables, too, possibly).

A constant may be used most likely to keep a variable that is available to any script from changing its value due to any foreign script interfering.


This article is a stub - an incomplete placeholder article that gives some idea of what is being talked about, but fails to adequately elaborate on the given subject. Feel free to help GraalBible by expanding upon it.