Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBC] Scrolling Text Box Function With Text Wrap

Author
Message
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th Jan 2008 21:16 Edited at: 29th Jan 2008 05:04
This function for DB Classic can be used instead of the Print command to output text to the screen.

The difference is that you can also define a rectangle on the screen into which the text is placed, the background colour of this rectangle and the colour of the printed text.

There's also a border flag so you can have a white line defining the text area if you need it.

When the maximum number of lines available in the text area have been used, the next call to ScrollPrint() will automatically scroll the existing text up to accommodate the new text. Also, lines wider than the text area are automatically wrapped onto the following line.

Calling the function with different variables allows you to have multiple text box areas on the same screen (as shown in the demo).

The Function:



Example Demo Program:



Important: Please note that you must initialise the three arrays at the start of the demo in your own program.

Finally, this function was written for a specific task in one of my own programs and not as a 'does everything for everybody' function.

If it doesn't quite suit what you need it for, just shout and I'll see what I can do to amend it to your requirements.

TDK_Man

Login to post a reply

Server time is: 2024-11-22 13:45:41
Your offset time is: 2024-11-22 13:45:41