data storage

write b50,xxx,xxx,xxx
not sure which way data is stored...is it

b50 (data,data,data) (data,data,data)ect..until 225
or
b50 (data,data,data)
b49(data,data,data)
b48(data,data,data)


or can it be both ways depending on code?
ty for the help
 

hippy

Ex-Staff (retired)
I'm afraid I can't really follow the question.

If variable 'b50' contained the value 27, "WRITE b50,1,2" would put the value 1 in Data Eeprom location 27 and the value 2 into location 28.
 
So if Iam understanding right

symbol apple = 1
symbol pear = 2
symbol orange=3
b50=0

write b50,1,2,3
b50=b50+3

the above would put the apple in b50 location 0 of b50, then put the pear in location 1 of b50, then put the orange in location 2 of b50

then the next time it writes to the eeprom. 3 would be added to the b50 value putting the apple in location 4 of b50 ect....

is this correct?
 
Last edited:

hippy

Ex-Staff (retired)
Not really. There is no "location 0 of b50" etc. There's a set of drawers which can hold values which we call Data Eeprom and 'b50' is a variable which holds a number. The WRITE command says put these numbers in the drawers indicated by the value held in b50. The value in b50 will not be changed by the WRITE command.
 

BeanieBots

Moderator
I fear you have also misunderstood the use of 'symbol'

In your example code, you have defined three symbols, namely apple, pear and orange as 1, 2 and 3 respectively but then you don't use them. Hence the three symbol lines are completely irrelevant in your example code.

As for the rest of code..

b50=0
This line is simple enough, it make b50 have the value zero.

write b50,1,2,3
This line will go to the EEPROM location pointed by b50 (which is zero) and then put the value 1 into that location. It will then go to the next EEPROM location and put in the value 2 and finally it will go to the next location and put in the value 3.

b50=b50+3
This line will take the starting value of b50 (which is zero) and then add 3 to it which results in b50 having a value of 3.
 
Top