Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By Gennadiy
#58382 To support the output of the alphabet on the dot matrix on MAX7219 chip is very necessary to implement the array. Please consider the possibility of introducing operators to storage arrays and data transfer from the array into variables.

Thank you.
User avatar
By Mmiscool
#58408 What do you mean by operators.

Arrays in ESP BASIC can be used just like normal variables.

Assigning a value to an arrays eliment is as simple as using the = sighn.

Code: Select allmyarray(1) = 5000


Retrieving a value from an array is simple also.

Code: Select allx = myarray(1)


x = myarray(2) *3 - 2



Code: Select alldim myarray(10)

for x = 1 to 10
myarray(x) = x*10
next x

for x = 1 to 10
print myarray(x)
next x
User avatar
By Gennadiy
#58641 It is very cool.
I understood how to work with it.

There are another problem!

How to store invariable arrays of flash memory?
How to output the desired data from the array into variables?

Think about this questions.

Example 1
Bla = read ({item name}, {line number})
Bla = read ({test.dat}, {3})
Bla variable outputs to the third line of the file
test.dat

Example 2

Bla = Lookup({2}, {0})
Bla = Lookup({Four}, {5})

0:
Data &H3E , &H51 , &H49 , &H45 , &H3E
1:
Data &H00 , &H42 , &H7F , &H40 , &H00
2:
Data &H42 , &H61 , &H51 , &H49 , &H46
3:
Data &H22 , &H41 , &H49 , &H49 , &H36
Four:
Data &H18 , &H14 , &H12 , &H7F , &H10
Five:
Data &H27 , &H45 , &H45 , &H45 , &H39
Six:
Data &H3E , &H49 , &H49 , &H49 , &H32
Seven:
Data &H61 , &H11 , &H09 , &H05 , &H03
Eight:
Data &H36 , &H49 , &H49 , &H49 , &H36
Nine:
Data &H26 , &H49 , &H49 , &H49 , &H3E
User avatar
By Mmiscool
#58645 See the following link for an example on how I stored data in the file system in an array like manner.

viewtopic.php?f=40&t=11995