Try this code (18F452) :
Code: Select all
program Test_Glcd
symbol item_menu = 5
Const menu1 as string[item_menu][10] = ("AAAAAAAA","BBBBBBBB","CCCCCCCC","DDDDDDDD","EEEEEEEE")
dim
text1 as string[10]
i as byte
main:
TRISA = $FF
TRISB = 0
TRISD = 0
ADCON1 = 7
ADCON0 = 0
PORTA = 0
Glcd_Init(PORTB, 2, 3, 4, 5, 7, 6, PORTD)
Glcd_Fill(0x00)
Glcd_Set_Font(@FontSystem5x8, 5, 8, 32)
i= 0
do
Text1 = menu1[i]
Glcd_Write_Text(Text1,0,i+2,1)
inc(i)
loop until i = 2
i=0
Text1 = menu1[i]
Glcd_Write_Text(Text1,0,i+2,1)
end.
Now after the loop, there is exactly the same instructions but behaves differently than the first loop instruction in Text1 = menu1 (i = 0)
Text1 is loaded and simulated with jerk string. It was ok inside the loop.
Well, I hesistate a while to publish this topic here rather than MB forum. (thinking hardly this is a bug and not a code problem. )