Bad choice of words, on my part. I meant that the EFFECT on your display, was the same effect as a CR/LF combo. Same as on a regular monitor, you don't want to print something at the last address on the line, in order to avoid line wrapping.
Although it can be done with one loop, I usually use two functions. The first has the "smarts", and sends the second (which actually does the printing), function the line # (an address in your case), and the content of the text char's to be displayed, which are already truncated to fit into the space that I need it to fit into.
I use variables like start_row, stop_row, current_row, and margin, to make it ez to visualize just what needs to be done next, in the logic.
If you'll give me a little sample of what you want for output, I'll hack up something to show you what I mean. It will be in rows, instead of addresses, but the idea is just the same.
I'm not trying to belittle your efforts or be "combative", here. I'm just not good enough at programming to make hide nor hair out of your sample code. I only know one way to do this, (using one or two loops, but it's the same logic).
When you say "scroll", show me EXACTLY what you want. If you're thinking that I'm thinking what you're thinking, we're both thinking down the wrong path, here.
Please be precise, I won't do this twice.
Edit: My understanding is you want each char to scroll from right to left on each line, and to have new text appear on the bottom line, and be moved upward by one line, as the next (new) line is being entered.
Code:
*****12345678901234567890
*****==================
Line 1 ==================
Line 2 ==================
Line 3 ==================
Line 4 =================A
Line 1 ==================
Line 2 ==================
Line 3 ==================
Line 4 ===============A L
Line 1 ==================
Line 2 ==================
Line 3 ==================
Line 4 ==============A Lo
Line 1 ==================
Line 2 ==================
Line 3 ==================
Line 4 =============A Lon
Line 1 ==================
Line 2 ==================
Line 3 ==================
Line 4 ============A Long
Line 1 ==================
Line 2 ==================
Line 3 ==================
Line 4 ===========A Long T
Line 1 ==================
Line 2 ==================
Line 3 ==================
Line 4 ==========A Long Ti
~~~~~~~~~~~~~~~~~~~~
Finally ending with:
Line 1 A Long Time Ago =====
Line 2 in a galaxy far, far ====
Line 3 away, there were - ===
Line 4 Star Wars! =========
After this, the first line would scroll off the display, right?
Do you want each line to move all the way to the leftmost position on that line, before the new line is added,
causing that line to be moved upward?