More compiler oddities
Just for the record.
You don't need to declare a CON block.
Starting the file with..
FRED = 24, A = 1, B = 2
.. works perfectly..
You don't need to declare your enumerators from zero.. it happens by default in the con block..
so
CON A, B, C
za = 24, zb = 25
D, E, F
will give you A = 0, B = 1, C = 2, D = 3... and so on..
You can space your enumerators..
#0, A[noparse][[/noparse]10], B[noparse][[/noparse]10], C[noparse][[/noparse]10]
will give you A = 0, B = 10, C = 20..
And you can use pre-defined constants and mathematics in the [noparse]/noparse fields..
so
zz = 20
A[noparse][[/noparse]zz], B[noparse][[/noparse]zz+10], C[noparse][[/noparse]zz]
will give you A = 0, B = 20, C = 50..
You never know when it might come in handy [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pull my finger!
You don't need to declare a CON block.
Starting the file with..
FRED = 24, A = 1, B = 2
.. works perfectly..
You don't need to declare your enumerators from zero.. it happens by default in the con block..
so
CON A, B, C
za = 24, zb = 25
D, E, F
will give you A = 0, B = 1, C = 2, D = 3... and so on..
You can space your enumerators..
#0, A[noparse][[/noparse]10], B[noparse][[/noparse]10], C[noparse][[/noparse]10]
will give you A = 0, B = 10, C = 20..
And you can use pre-defined constants and mathematics in the [noparse]/noparse fields..
so
zz = 20
A[noparse][[/noparse]zz], B[noparse][[/noparse]zz+10], C[noparse][[/noparse]zz]
will give you A = 0, B = 20, C = 50..
You never know when it might come in handy [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pull my finger!

Comments
Using that technique, here's an easy way to express a Fibonacci sequence using CON:
[b]CON[/b] [b]_clkmode[/b] = [b]xtal[/b]1 + [b]pll[/b]16x [b]_xinfreq[/b] = 5_000_000 #1, a[noparse][[/noparse]0], b[noparse][[/noparse]a], c[noparse][[/noparse]b], d[noparse][[/noparse]c], e[noparse][[/noparse]d], f[noparse][[/noparse]e], g[noparse][[/noparse]f] [b]OBJ[/b] pr : "tv_wtext" [b]PUB[/b] Start | i pr.start(12) pr.dec(a) pr.out(" ") pr.dec(b) pr.out(" ") pr.dec(c) pr.out(" ") pr.dec(d) pr.out(" ") pr.dec(e) pr.out(" ") pr.dec(f) pr.out(" ") pr.dec(g)-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
It certainly has the potential to be useful anyway..
Another "interesting" point is the [noparse]/noparse block does not need to be attached to its parent. Whitespace is gracefully ignored.
ie
CON
A [noparse][[/noparse]10] , B [noparse][[/noparse]10]
VAR
long Fred [noparse][[/noparse]15]
are all perfectly valid.. it makes it easier when looking at it from the perspective of a tokenizer..
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pull my finger!
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
Phil: I love that fibo sequence idea.
"Makes sense" In a kind of Alice in Wonderland way. Strangest syntax for enums I ever saw.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
So this enumeration syntax seems to be expected, but not documented in the Manual.
Andy