i'm trying to indexing arrays with an ofset. But it doesn't work correct.
- Code: Select all
Dim Tmp_byte As Byte
Dim Timer_index As Byte
Dim Timer_load As Byte
Dim Pwm_table(10) As Byte
Dim Timer_table(10) As Byte
...
Timer_index = 0
Tmp_byte = Timer_index + 1
Timer_load = Pwm_table(timer_table(tmp_byte))
Print Timer_load ; " ";
Timer_load = Pwm_table(timer_table(timer_index + 1))
Print Timer_load
Pwm_table and Timer_table are filled with valid values, but i got different results for Timer_load.
What's wrong?
Thanks in advance
(Bascom AVR 2.0.7.0)