Quote: "I did not know I could do that with constants.."
You can do quite a lot with constants really. They are essentially a token:string pair that get pre-processed at compile time to inject the raw text of the string into the source code at any instance of token, meaning you can inject just about anything including more source code not just simple values.
#CONSTANT FOREACH_Media_imageList for imageIndex = 0 to Media.imageList.length
#CONSTANT THIS_Image Media.imageList[imageIndex]
FOREACH_Media_imageList
print( THIS_Image.fileName + " (" + Str(THIS_Image.number) + ")" )
next imageIndex
Effectively becomes on compile:
for imageIndex = 0 to Media.imageList.length
print( Media.imageList[imageIndex].fileName + " (" + Str(Media.imageList[imageIndex].number) + ")" )
next imageIndex
much more readable I think, and more convenient to write too
http://games.joshkirklin.com/sulium
A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.