Why woul three CONST separated by colons ":" be any different than having three CONST on different lines?
I always thought ":" was equivalent to a new line.
CONST is an internal replacement type routine, and with the colon parsing, it’s a little buggy with self referential calls on the same line.
CONST x = 3: CONST y = x
The above line of code will probably glitch out on you, as QB64 tries to process it. The x = 3 should register a CONST value of x, but it doesn’t update those definitions until it gets to the end of the line, so the second segment will see y = x as being an undefined variable reference.
If colons were handled as separate lines, we wouldn’t see this glitch, but they’re not. They’re more indicators of segmenting a line of code into multiple commands. Think of the following:
x = 3: y = 4: PRUNT x + y
Whoooops!! I misspelled PRINT! Which LINE is that code on, when the error pops up at the bottom line of the IDE?
It’s on line 1, not line 3.
*************************
Generally speaking, CONST
should work without any glitches in relation to colons, but it current
doesn’t. Since it’s generally an easy work around (just separate the lines), and I’ve been occupied with other things in life, it hasn’t been a high priority fix on my list of things to do.
Turn
CONST x = 3: CONST y = x
into:
CONST x = 3
CONST y = x
And the glitch should go away, when it presents itself.