12-16-2022, 12:03 PM
(12-16-2022, 11:01 AM)mnrvovrfc Wrote: If the "BadLimit" isn't going to be part of QB64PE or a separate BASIC-like interpreter, why set a "default" value if another value is assigned on RHS?
The default is our fallback value, in case the user edits the config file and puts something invalid as the value.
For example: KeyCode AS Integer From 0 to 255 Default 0 = O
Now, in case it's not obvious with the browser font there, the default is ZERO, while the user set the value as the capital letter "O". Now, when reading in the setting, our check tells us that "O" is an invalid value, so it reverts back to the default value of 0 (zero).
And, before you start wondering if the user can mess with the limits or default values, they can't -- we don't actually read those back from the config file. We set them when we declare a config setting with Sub DeclareConfigSetting. They're mainly just there in the config file for user reference, to help them know what the acceptable ranges are, and the fallback value is, in case they do something wrong with the file.