-
Advanced Arrays
I'm a bit confused about arrays, I'm trying to initialize an array at runtime from saved EEPROM data, but I don't really understand how to edit what I need.
Here is my array of users, but PBP won't let me
Code:
Users[10].bit0 = 0 (syntax not supported)
However
compiles fine. And
does not. Is there any easy way I can access each byte of the Users array within a for loop? If all else fails I could rewrite it using this http://www.picbasic.co.uk/forum/showthread.php?t=2444 but It'd be nice to see what the compiler is up to :)
-
It seems that everything is explained here and google is a much better search engine than vBulletin apparently :)
http://www.picbasic.co.uk/forum/showthread.php?t=544
Code:
For i = 0 to 19
read i, Users.Lowbyte(i)
Next i
Compiles without a problem, I'm hoping that this will load the first 20 EEPROM bytes into the 10 words I have, correct?
-
Faq
Hi
If you dig deep enough in the FAQ section by selecting "Show all threads from the beginning" you will find a Melanie artwork called Bits, Bytes Words and Arrays. Or you click here http://www.picbasic.co.uk/forum/showthread.php?t=544
This will give you all the answers you'll need for accessing an array and other neat tricks that will come in handy later in life.