Check out this for Types:
http://forum.thegamecreators.com/?m=forum_view&t=55858&b=1
Globals are variables that can be access throughout the program including funtions. Everything in a function is local meaning it's seperated from the main program. An example:
i as integer
i=1234
MyFunc()
wait key
function MyFunc()
print i
endfunction
In the function you can see the "print i". i should print 1234, but because a function is seprate, i equals nothing(0). You could input i into the function like so:
i as integer
i=1234
MyFunc(i)
wait key
function MyFunc(value)
print value
endfunction
Using a global will let the function access the variable i as so:
global i as integer
i=1234
MyFunc()
wait key
function MyFunc()
print i
endfunction
For #constants I would like to quote Scraggle.
Quote: "
A #Constant is the opposite of a variable.
Like a variable it too can hold a value but unlike a variable it's value is constant.
Sounds pretty pointless right?
Well, not really. I find they come in very handy when writing your code because they tidy things up a little.
For example: If I have a complex equation that I struggle to remember and can't be bothered typing each time I use it, then I could declare it as a #constant (have a look at 'c' in the code) or maybe I just want to replace values with words to make it make it easier to remember what they are doing. (Black & White in the code)
"
An here the example:
#Constant c a+b
#Constant White 1
#Constant Black 0
a = 2
b = 3
d = Black
print "a = " + str$(a)
print "b = " + str$(b)
print "c = " + str$(c)
if d = White then Print "It's all good!"
if d = Black then Print "It's not very good at all"
a = 56
d = White
print
print "a = " + str$(a)
print "b = " + str$(b)
print "c = " + str$(c)
if d = White then Print "It's all good!"
if d = Black then Print "It's not very good at all"
wait key
end
Hope this helps.