Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Names
#10
To pile on to all the stuff others have already pointed out ( Tongue ), there are numeric literals that include alphanumeric characters, so allowing variables to start with numerals create pretty bad ambiguities even in QB45/QB64 where spaces are required around most things:

Code: (Select All)
Dim 20D As Long
20D = 50
A = 20D ' Is A set to 20 or 50?

Of course, this could be fixed by simply not allowing you to use variable names that could be confused with a numeric literal, but:

1. That's a lot of extra work for little gain, simply banning variables from starting with a numeric is much simpler.
2. It would prevent us from adding any new numeric syntax's in the future if they would conflict with allowed variable names.

There's probably some other conflicts that I haven't considered, but that's the most obvious to me.
Reply


Messages In This Thread
Variable Names - by Dimster - 11-19-2023, 06:18 PM
RE: Variable Names - by RhoSigma - 11-19-2023, 06:46 PM
RE: Variable Names - by CharlieJV - 11-19-2023, 07:46 PM
RE: Variable Names - by James D Jarvis - 11-19-2023, 07:52 PM
RE: Variable Names - by Haggarman - 11-19-2023, 07:58 PM
RE: Variable Names - by SMcNeill - 11-19-2023, 08:12 PM
RE: Variable Names - by bplus - 11-19-2023, 08:23 PM
RE: Variable Names - by mnrvovrfc - 11-19-2023, 09:01 PM
RE: Variable Names - by Jack - 11-19-2023, 10:43 PM
RE: Variable Names - by DSMan195276 - 11-19-2023, 11:01 PM
RE: Variable Names - by Dimster - 11-20-2023, 01:46 PM
RE: Variable Names - by mnrvovrfc - 11-22-2023, 01:46 AM
RE: Variable Names - by Jack - 11-22-2023, 10:17 AM
RE: Variable Names - by mnrvovrfc - 11-22-2023, 09:47 PM



Users browsing this thread: 10 Guest(s)