Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BadLimit
#3
(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.
Reply


Messages In This Thread
BadLimit - by SMcNeill - 12-16-2022, 03:50 AM
RE: BadLimit - by mnrvovrfc - 12-16-2022, 11:01 AM
RE: BadLimit - by SMcNeill - 12-16-2022, 12:03 PM
RE: BadLimit - by SpriggsySpriggs - 12-21-2022, 02:53 PM
RE: BadLimit - by SMcNeill - 12-21-2022, 03:20 PM
RE: BadLimit - by mnrvovrfc - 12-21-2022, 03:53 PM
RE: BadLimit - by SpriggsySpriggs - 12-21-2022, 04:06 PM
RE: BadLimit - by SpriggsySpriggs - 12-21-2022, 04:25 PM
RE: BadLimit - by SMcNeill - 12-29-2022, 10:40 AM
RE: BadLimit - by MrCreemy - 12-29-2022, 06:31 PM



Users browsing this thread: 1 Guest(s)