XanthorXIII has pretty much nailed it.
Some extra cases for #constants and the reason I usually use them is for things like this:
#constant true 1
#constant false 0
this allows me to write If statements like this.
if getfileexists("data.dat") = true then deletefile("data.dat")
the alternative would naturally be
if getfileexists("data.dat") = 1 then deletefile("data.dat")but many developers find it easier to read "true" then 1, usually because they are used to multiple languages such as C++ or Visual Basic. Now if you want to use this method, you sure as heck don't want true and false changing on you. It would break your program instantly!
I also use it to code in colours:
#constant black 0, 0, 0
setprintcolor(black)and of course more complicated colours are easier to name, then remember the code too.
#constant crimson 220 20 60
#constant gold 205 215 0
#constant olive 128 128 0etc etc
Another way I tend to use constants is for scancodes, I've not used these in AppGameKit but I use these in DarkBASIC Professional all the time
#constant a 30
#constant b 48
#constant c 46
#constant d 32etc etc
this allows me to refer to the key specifically, without having to remember that keys scancodes.
When working on larger projects, I have a subroutine for DBPro saved, that I just include in any program, and all the basics are there, common colour names, scancodes, true, false, especially when I'm working on media-less code examples.
The colour codes are a very good reason for constants, if you were to do this with varibles, you'd have to setup a data type.
Type colours
r as byte
b as byte
g as byte
Endtype
gold as colours
gold.r = 205
gold.g = 215
gold.b = 0
setprintcolor(gold.r, gold.g, gold.b)Constants don't have to worry about the type of data being held, they don't care if it's a float, a string or an integer. It just stored the colour code I normally type directly into setprintcolor and that's the end of it.
#constant gold 205 215 0
setprintcolor(gold)easy, huh?