LB Booster
« Cannot clear screen in console application »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:45am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Cannot clear screen in console application  (Read 868 times)
XephreWolf
New Member
Image


member is offline

Avatar




PM


Posts: 1
xx Cannot clear screen in console application
« Thread started on: Dec 9th, 2013, 04:22am »

One pet peeve I'm having with console applications is that the "cls" command does not function.

For instance, running the following...
Code:
print "Line A"
cls
input "Line B"; dummy
end 


...produces, as expected, this output in the default mainwin:
Code:
Line B 


but produces this output when compiled as a console application:
Code:
Line A
♀Line B 


I was just wondering if there are any plans for fixing this?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Cannot clear screen in console application
« Reply #1 on: Dec 9th, 2013, 09:21am »

on Dec 9th, 2013, 04:22am, XephreWolf wrote:
I was just wondering if there are any plans for fixing this?

I don't think it would be easy to make CLS work - it sends a chr$(12) (Form Feed) character, and it's up to the receiving end how that is interpreted. The standard Windows console simply displays a symbol.

However you can clear the console screen from a LBB program:

Code:
    run "cmd /c cls" 

although you will probably want to add a short delay afterwards before sending anything else:

Code:
    input "Line A? "; dummy
    run "cmd /c cls"
    timer 100, [cont]
    wait
[cont]
    timer 0
    input "Line B? "; dummy 

Richard.
« Last Edit: Dec 9th, 2013, 09:43am by Richard Russell » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Cannot clear screen in console application
« Reply #2 on: Mar 15th, 2014, 11:39pm »

on Dec 9th, 2013, 04:22am, XephreWolf wrote:
One pet peeve I'm having with console applications is that the "cls" command does not function.
I was just wondering if there are any plans for fixing this?

I have recently worked out how this can be achieved, so you can expect a future release of LBB to support CLS in a console application. Thanks for suggesting it.

Edit: CLS in console applications now implemented in LBB v2.53.

Richard.
« Last Edit: Mar 22nd, 2014, 4:13pm by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls