I have an edit box I'm using as a status-reporting box in FTN95. I implement it by using: [color=blue:83bb4297fe] CHARACTER*32000 statstg
i=winio@('%64.10eb[hscrollbar,vscrollbar]',statstg,32000)
[/color:83bb4297fe]
As the program runs, every now and then I post new messages in this box. To do this, I remove any NULL (CHAR(0)) from the end of statstg, append a linefeed (CHAR(10)), then append the new message, and finally append a NULL. Then I call window_update@(statstg) to display the entire string of messages, including the new message.
This is working well, for the first ten sentences or so. But then the sentences start scrolling off the visible area in the box. I can bring them back by clicking and dragging the vertical scroll bar, and that works too.
But is there a way I can have the system automatically 'drag the scroll bar', so that each time a message is posted then entire string moves up until the new message is visible at the bottom of the box, without the user having to click and drag the scrollbar manually each time?
I'd imagine the solution might (or might not) involve doing an ADJUSTR(statstg) to move all the sentences to the end of that (very long) statstg, and then simply scroll all the way to the bottom each time somehow. A good solution, but not a perfect one - the scrollbar at the right side of the edit box, would become really teeny, and moving it even a millimeter would cause huge jumps in the string, as though the string contained many hundreds of sentences.
I guess I have two questions:
1.) How do I make the system scroll the vertical scrollbar automatically, to the very end of the 32,000-character string if necessary (i.e. if the characters are right-justified in the string)?
2.) How do I make the system scroll only to the end of the printing characters in the string, if they are left-justified in the string? Currently they are terminated with a CHAR(0) - does that help?
Thanks, all!