Hi,
I modified a bit your code as below (array[x] replaced by string[x], and for i=0 to 8 replaced by for i = 0 to 7) but the code doesn't works. So Itried with this one to find a solution which works :
Code: Select all
Const text1 as string[8][2] = ("AA","BB","CC","DD","EE","FF","GG","HH")
dim i, j as byte
j = 63 ' J variable is used to define the x location
for i = 0 to 7 ' i variable is used to go through the array's elements
Glcd_Write_Text(text1[i] , j ,3,1)
j = j + 8
next i
This code works but I would need a single character for text1 so I wrote code below but doesn't compile and give this error (in Glcd_write_text instruction) :
Incompatible types (char to ?2)
Code: Select all
Const text1 as string[8] = ("A","B","C","D","E","F","G","H")
dim i, j as byte
j = 63 ' J variable is used to define the x location
for i = 0 to 7 ' i variable is used to go through the array's elements
Glcd_Write_Text(text1[i] , j ,3,1)
j = j + 8
next i
It seems that multi array string works at least with 2 lengh string.
So I tried this one :
Code: Select all
Dim text1 as string[8]
dim i, j as byte
text1 = "ABCDEFGH"
j = 63 ' J variable is used to define the x location
for i = 0 to 7 ' i variable is used to go through the array's elements
Glcd_Write_Text(text1[i], j ,3,1)
j = j + 8
next i
But still compilation error.
So I tried this solution which works :
Code: Select all
Dim text1 as string[8]
dim res as string[1]
dim i, j as byte
text1 = "ABCDEFGH"
j = 63 ' J variable is used to define the x location
for i = 0 to 7 ' i variable is used to go through the array's elements
res[0] = text1[i]
Glcd_Write_Text(res, j ,3,1)
j = j + 8
next i
Seems there is a problem with instruction like : Glcd_Write_Text(text1
, j, 3, 1)