The #constant make a certain variable, well, constant. As The Nerd says, unchangeable. Although it also makes the variable GLOBAL. If you don't know the GLOBAL command, then it makes a variable valid in all scopes. Umm... Here's an example:
var=10
printVar()
function printVar()
print var
wait key
endfunction
That code will print '0' to the screen. All variables you declare outside a certain scope, will not be available inside the scope(function). But if you make the variable #constant or GLOBAL, the variable becomes available in all scopes:
global var=10
printVar()
function printVar()
print var
wait key
endfunction
The #constant can also help your code look clearer. If fx. you have an alien spaceship in your game, then you want the spaceship to damage the player with the same value each time it hits. You could write it like this(pseudocode, not real code):
if spaceshipShotPlayer()
dec playerHealth, 15
Then the player will loose 15 healthpoints each time he's hit. But later on, you might get back to this piece of code and think: ,, Why does it say fifteen?".
You can simply write the code like this, to make it more readable and easier to understand:
#constant alienDamage=15
if spaceshipShotPlayer()
dec playerHealth, alienDamage
Now you can see that the players health is decreased, with the amount of the aliens damage.
I hope this helps you
I can't be fired... Slaves are SOLD!