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.

DarkBASIC Professional Discussion / Print command and scrolling

Author
Message
Divided
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 14th Nov 2014 15:35
Hey!

I'm currently developing a text based program and I use the print command often.
I notice that I don't want the program to scroll down after it reaches the end of the screen.

What would be a good solution for this and if possible how to implement it.
Basically I would like the program to, once reached the bottom, to either clear
itself and go back to the later point in time or stop scrolling down and just
clearing the bottom three(ish) lines re printing the message.

Thank you to anyJuan who can help.



DividedV -- YouTube Channel
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 15th Nov 2014 14:02
Howdy!

Instead of PRINT, try using either TEXT or CENTER TEXT.

Divided
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 15th Nov 2014 14:07
Thank you for your response!

I currently use both but predominantly print as it is perfect for the
situation. The only problem is when a user doesn't enter a word correctly
an error message appears. if the user enters the wrong thing too many
times, the screen will start to scroll, effectively moving my TEXT
commands up the screen where they shouldn't be and out of the sight of
the user.



DividedV -- YouTube Channel
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Nov 2014 15:31
ENTRY$

Divided
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 15th Nov 2014 15:35
Thank you very much!



DividedV -- YouTube Channel
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Nov 2014 15:55


Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Nov 2014 04:07
Use SET CURSOR in conjunction with PRINT to keep text in the same place and prevent the scrolling effect.


"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Jeff Miller
21
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 16th Nov 2014 13:03
The way to prevent the print command from resetting the cursor to the next line (which can move up all the preceding text when the next line would be below the bottom of the screen) is to end the print command with a semicolon.
PRINT text$;
Without the semicolon, DBPro executes a "carraige return" after executing the command, thus placing the cursor at x=0 and y= beginning of next line.
gamerboots
17
Years of Service
User Offline
Joined: 8th Dec 2008
Location: USA
Posted: 16th Nov 2014 16:07 Edited at: 16th Nov 2014 16:08
Alternately, you can use printc , or text commands. If you use the text commands then you can clear an area using the box command in conjunction with the ink command (be sure and reset the ink back to normal color instead of using the background color) Here is an example for you.


--------
DBP Archive
Divided
FPSC Reloaded TGC Backer
12
Years of Service
User Offline
Joined: 31st Oct 2013
Location:
Posted: 17th Nov 2014 01:27
Thanks guys! very helpful!



DividedV -- YouTube Channel

Login to post a reply

Server time is: 2026-07-17 12:28:29
Your offset time is: 2026-07-17 12:28:29