And how that going to help?
I want to change that offset runtime...
And how that going to help?
I want to change that offset runtime...
If you know the offset is 20, give that byte a name as Ioannis suggested. This will act as a place marker for your start point. You can also use a variable start point:
Code:CondVar = inputVal TXREG = all_data[20+CondVar]
Last edited by mpgmike; - 11th August 2022 at 16:41.
There's no way to do that directly using ARRAYWRITE (perhaps there is, by preloading system variables, but I'm not going to research that). But if you have some RAM to spare you can:
Code:ActualArray VAR BYTE[32] TempArray VAR BYTE[16] Start VAR BYTE idx VAR BYTE Main: ArrayWrite TempArray,["Hello World!", 0] ' What you want written, note the null at the end = important! Start = 10 ' Where you want it written in the main array, make sure to not go out of bounds. GOSUB WriteArray END WriteArray: idx = 0 WHILE TempArray[idx] <> 0 ActualArray[Start + idx] = TempArray[idx] idx = idx + 1 WEND RETURN
Well the situation is as follows, I have an array, which is used as a display buffer - separate routine reads data from it, decodes and sends to display.
I want to do some text scrolling, so want to write same line of text into that array, with some offset, to create the scroll effect.
![]()
And I belive what I showed can be made to do that - not that it neccesarily is the best way to achieve your end result but never the less :-)
Instead of "write same line of text into that array, with some offset" modify the actual display routine so that it doesn't start displaying from index 0 of the screen buffer.
Yes that is what I planned.
To make display buffer 24 byte wide, instead of 8, and "read" it with changing offset, to achieve the scrolling effect. But this means that text data should be written into "center" of array - from 8th position to 16th.
Bookmarks