Quote: "My logic goes back to the old saying... "it's better to have it and not need it, than to need it and not have it." "
So true and very practical, it's like going to climb a mountain with a 20 kg backpack fully equiped for long term survival and discovering you are stuck on the mountain peak for a week, but then again you could have climbed it much lighter with a 10kg bag only equipped for a mere hike without any tent or sleeping bag and the nights on mountains are always cold.
Rik Vanner in his Riktris used 2 constants, one for grid x size, the other for grid y size, so I guess if he wanted the grid size to be optional by the player he would probably have defined them as variables. Also, in his Database tutorial code he used a constant for the total number of database entries.
Quote: "Funny thing, they actually have a Wikipedia page"
This is hiklarious! This place is sometimes like a comedy show.
Quote: ""You've changed!"
- Said the constant to the variable"
Quote: "IE: "#Constant Key_Escape GetRawKeyPressed(27)" is valid syntax "Key_Escape" will return 1 if the key is down, 0 if not."
Didn't quiet understand the mechanics of this part, until this explained it:
Quote: "Right, #CONSTANT is basically a preprocessor macro that does a match and replace at compile time.
You can really stick any one line of code you want in there and anywhere the constant is used will be converted to and compiled with the literal text assigned to it.
They don't exist at runtime and have no inherent local/ global scope as they were simply replaced with the assigned text inline at compile.
They are super handy"
Really good to know, that's it's not just about values, but actual code that can be used, despite I haven't tested this myself to understand it better in practice.
Quote: "Knowing that you can execute the compiler from the command line it would be cool to have a pre-processor that implemented the cpp pre-processor commands like #ifdef #else etc"
One time as I was coding something, I was trying the code to do something impossible at least for AppGameKit Basic, meaning to create a variable whilst the code is running, so from a string, convert the string into an actual variable that can store data. Something like create code whilst the code is running. Sounds crazy, but I was trying at some point for the program to be able to do that. I didn't find the function command for it to make it possible.