Define Project-Level Constants Without Initial Values
In modules or classes, you might define constants as placeholders for subclasses or platform-specific overrides. Leaving them blank avoids committing to a default that may not be valid in all contexts.
Allow Tooling to Inject Values
External build scripts or CI/CD tools may inject values into the constant slots, e.g., version numbers, API keys, or toggles, depending on the environment.
What Happens If You Use It Without a Value?
If you reference a constant that has no value at compile time, Xojo will throw a compiler error. So while it’s allowed to define a constant without a value, it’s not allowed to use it without ensuring it has one under the appropriate condition.
Would you like to see a real-world example involving #if DebugBuild or platform-specific constants?
i say this with every dev tool i touch: it would be much MUCH better if the docs were in a wiki.
not a repo, where someone has to accept a PR, but a wiki, where the community runs it.
The reality is that while there are lots of people that would add valuable info, there’s also the possibility that a disgruntled customer or other nefarious actor will try to deface the wiki. Even if it requires approvals, the number of edits to review could be very time consuming.
If you have a problem with the docs, file a bug report. They can fix it quickly and out-of-band.
Sorry Tim. I know you are touchy about this. I should have done more testing.
Reading the AI answer just made me comfortable with the notion that there was some exotic reason that one might not want to provide a value immediately when a Const was declared, but I would never do it myself because my programming style and ability is plain Jane. I failed to determine that the AI answer was wrong.
It is nice that the Documentation has been fixed so quickly.