As this rule applies to every programming language I have used (except VB - I can't say that I know whether it applies to VB) - there must be some reason for this. There must be some underlying computer architecture reason for why a compiler will not accept a variable who's name begins with a digit. It would be interesting to know why this is.
<<edited>>
This page gives a hint: http://www.ladysharrow.ndirect.co.uk.../chapter_2.htm
Code:
1 When the assembler looks at something it needs to know
whether it is a name or a number. Is 'A7' a name or a hex number?
Is '3D' a name or a number? To solve this problem, all assemblers
and all compilers insist that -> if the first character is a
number, it's a number; if the first character is not a number, it
is not a number. That is why you can't start a variable name with
a number.
And the flip-side to this is that hex numbers must start with a numeral:
Code:
4. A hex number. A hex number must start with a number, so if the
highest digit is A - F, there must be a 0 in front.{1} b77h is
illegal, 0b77h is legal.
I learn something every day
Bookmarks