Quote: "Is there a command to find the position of the cursor"
Not that I know of.
Quote: "I'm having a bit of trouble customising it to my needs"
You shouldn't have to customise other people's functions - they are the one example where you can post code in without having to understand it. All you should have to do is alter the parameters in the function call. You just need to know how to do it.
Quote: "Could I have an "abridged" version, to just create one text box on the screen (encompassing, say, the lower two thirds of the screen)?"
You already have it - the function will already do that. The demo program is only to show what you
can do with the function (if you want to) and it just uses the same function 3 times with different parameters - once for each text box.
You only need one text box, so you only need one set of parameters and one function call.
What to do:
1. Copy and paste the function into your program - put it at the end.
2. Copy the 3 DIM lines from the demo program and paste them in your program. At the very beginning is best, but anywhere will do so long as they are before the function call.
3. Where in your program you would use the Print (or Text) command, use the function call:
ScrollPrint(TextBoxNum,XPos,YPos,ScrollBoxWidth,ScrollBoxHeight,T$,BColour,TColour,Border)
TextBoxNum is the number of the text box on screen you want to write to. If you only have one box then naturally this stays as a 1.
XPos and
YPos are the X and Y position of the top left corner of the text box. The values for the bottom section of the screen depend on the current screen mode, but for 800x600 mode try 0 for XPos and 400 for YPos.
ScrollBoxWidth and
ScrollBoxHeight are the width and height of the text box. For the full width of the screen in 800x600 mode use 800 for ScrollBoxWidth and as the box starts at 400, ScrollBoxHeight would be 200.
T$ is the text to print in the text box.
BColour is the background colour of the text box. Use RGB() or a colour value to make it match the rest of your screen.
TColour is the colour of the text in the box. Use RGB() or a colour value to set it to whatever you want.
Border is a flag. Set it to 1 and you get a border around the text box. Set it to 0 if you don't want a border.
So, in your program, put the text to be printed into T$ with:
T$="The text to print"
and call the function:
ScrollPrint(1,0,400,800,200,T$,0,RGB(255,255,255),0)
This gives you a black, borderless text box occupying the bottom 200 pixels of the screen. All text will be white.
Simply alter the values in the function call to change what you get on the screen.
TDK_Man