Posted: 03:35am 05 Jun 2017 |
Copy link to clipboard |
Print this post |
|
Is it possible, or even worthwhile, to make an array using CONST instead of DIM?
For example, instead of:- CONST Page1LED_Ch1 = 11 CONST Page1LED_Ch2 = 12 CONST Page1LED_Ch3 = 13 CONST Page1LED_Ch4 = 14
It would be nicer to be able to do:-CONST Page1LED(4) = (11,12,13,14)
Of course this doesn't work, so I've had to resort to:-DIM Page1LED(4) = (11,12,13,14)
In the code I'm doing, I'm using 4 separate channels for sampling voltage/current, controlling relays and displaying a hell of a lot of information in GUI Pages. (Over 100 Elements at last check) Having 4 Constants in arrays would make coding simpler using FOR...NEXT loops instead of having to type all the individual routines out 4 times and bloating the code. I guess it's no real problem using a DIM instead of CONST in this case, but I like the CONST because there is less chance of me stuffing up the variables.....
Is it maybe worth a look at in future MMBasic releases?
Cheers,
GTG! ...... Don't worry mate, it'll be GoodToGo! |