cls and fullscreen in console mode

New to FreeBASIC? Post your questions here.
SyntaxError
Posts: 10
Joined: Feb 25, 2006 1:04
Location: Australia

cls and fullscreen in console mode

Postby SyntaxError » Apr 12, 2006 11:57

for x = 1 to 150
print x
next x
print" change to fullscreen now"
sleep
cls
print "why doesn't cls clear the whole screen and what would?"
sleep
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Postby anonymous1337 » Apr 12, 2006 12:22

It cleared the whole screen for me....Can't reproduce the error. Did you do this in a screenmode? I can't go fullscreen with command prompt whenever I please.
SyntaxError
Posts: 10
Joined: Feb 25, 2006 1:04
Location: Australia

Postby SyntaxError » Apr 12, 2006 12:48

No, I just ran this code straight through the ide and clicked on the top righthand thingy to maximise the console window.

This is how it looks on my box:

http://www.geocities.com/gartenzwergs/Untitled-1.jpg
steven522
Posts: 265
Joined: May 27, 2005 13:02
Location: Alabama, USA
Contact:

Postby steven522 » Apr 12, 2006 12:52

If you notice, even without going to full screen, the CLS only repositions the cursor to the top of the current 80x24 "screen". You can still scroll (with scroll bars) the screen up and see the previous numbers up as far as your console buffer will allow.

The "full screen" alt+enter on my pc goes to a total of 50 lines buffered and the CLS function only clears about half of that.
SyntaxError
Posts: 10
Joined: Feb 25, 2006 1:04
Location: Australia

Postby SyntaxError » Apr 12, 2006 13:13

hmm, I see...

There seem to be 300 lines in the buffer, what's a good way of clearing it?

All I really want to achieve is to not have any leftovers on the console screen.
SyntaxError
Posts: 10
Joined: Feb 25, 2006 1:04
Location: Australia

Postby SyntaxError » Apr 12, 2006 13:19

and what about the colour:

color 14,25
cls
for x=1 to 150
print x
next x
print" change to fullscreen now"
sleep
cls
print "why doesn't cls clear the whole screen and what would?"
print "and how do I get the whole window with a blue background?"
sleep

same story here, it only sets the background for a 24x80 screen, even when in fullscreen mode. Is there a workaround?
tunginobi
Posts: 655
Joined: Jan 10, 2006 0:44
Contact:

Postby tunginobi » Apr 12, 2006 13:37

SyntaxError wrote:hmm, I see...

There seem to be 300 lines in the buffer, what's a good way of clearing it?

All I really want to achieve is to not have any leftovers on the console screen.

Ain't it obvious? Dump 300 blank lines. :)


Seriously, there's no real need to worry about what goes on in the history of a console session. I play roguelike games, and they still have command line history above them if I scroll up. The ideaology is that the user shouldn't need to scroll upwards to use whatever program you're devising. The history shouldn't matter; essentially doesn't exist.

The history's there for the user's benefit, not for you to change on a whim.
steven522
Posts: 265
Joined: May 27, 2005 13:02
Location: Alabama, USA
Contact:

Postby steven522 » Apr 12, 2006 13:42

tunginobi wrote:The history's there for the user's benefit, not for you to change on a whim.


I agree. If I want to set my buffer to 99,999 lines so that I can scroll back and cut-paste sections of the console to a text file, then thats my priority.

If you want to switch to full-screen and have precise control, then use the text options in one of the gfxlib screens.
SyntaxError
Posts: 10
Joined: Feb 25, 2006 1:04
Location: Australia

Postby SyntaxError » Apr 12, 2006 14:30

What I know about other screen options would fit on the side of a matchbox :(

Could you recommend any good tutorials/docs on that?

Thanks guys
steven522
Posts: 265
Joined: May 27, 2005 13:02
Location: Alabama, USA
Contact:

Postby steven522 » Apr 12, 2006 15:07

Add the line:

SCREEN 18

to the beginning of your originally posted code and recompile.

The text acts exactly the same way (other than the buffer lines) and the full-screen switch acts the way you want.

You could also then incorporate graphics into the program easily.
SyntaxError
Posts: 10
Joined: Feb 25, 2006 1:04
Location: Australia

Postby SyntaxError » Apr 12, 2006 15:43

Thanks for the tip, I'll play around with that for a bit...
voodooattack
Posts: 605
Joined: Feb 18, 2006 13:30
Location: Alexandria / Egypt
Contact:

Postby voodooattack » Apr 12, 2006 18:26

Code: Select all

for x = 1 to 150
print x
next x
print" change to fullscreen now"
sleep
'-------------
    print
'-------------
cls
print "why doesn't cls clear the whole screen and what would?"
sleep


:-)

the extra print command will refresh things up ;)

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 1 guest