10-26-2025, 08:16 PM
(10-26-2025, 06:06 PM)CharlieJV Wrote:Quote:...snip...Just a thought:
CONSTANT's in someones code must be known at COMPILE time. Any parameter that is system dependent or can change on the same system between program runs can NOT BE A CONSTANT ! .
If I have a program that needs to remember the date and time when the program started, that is a CONSTANT for the specific run of that program.
The "run start date and time" value is different for every run, but it is constant within one run, and is never known at compile time.
I understand what your saying there. But a CONSTANT in the context of a Computer language is a very specific concept.
When you do
CONST PI = 3.1416
The compiler will usually insert that immediate value in the code at every place PI is referenced. If on the other hand you do
DIM PI AS DOUBLE
PI = 3.1416
Then your code will pretty much work the same as long as you DON'T CHANGE PI. But the code generated will be referencing a variable in memory and not an immediate value. There would be nothing to keep you from putting in your code. PI = 3.0 REM So There !!!!


