mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-09 12:50:17 +00:00
This moves the CONST replacement up before we turn the elements into a single string. The advantage is that we don't have to worry about splitting the string properly to find the CONST names as the elements are already split for us.t
24 lines
439 B
QBasic
24 lines
439 B
QBasic
$CONSOLE:ONLY
|
|
CONST glob = 60
|
|
|
|
foo
|
|
baz
|
|
|
|
SYSTEM
|
|
|
|
' SUB/FUNCTIONs should be able to define their on CONST that are local to that SUB/FUNCTION
|
|
' They should also be able to access the global CONSTs
|
|
SUB foo()
|
|
CONST a = 20
|
|
CONST bar = a + 20 + glob
|
|
|
|
PRINT bar
|
|
END SUB
|
|
|
|
' Separate SUB/FUNCTIONs should be able to define CONST values with the same names
|
|
SUB baz()
|
|
CONST a = 40
|
|
CONST bar = a + 20 + glob
|
|
|
|
PRINT bar
|
|
END SUB
|