Page 1 of 1

Screen clear function

Posted: Thu Oct 13, 2022 2:01 am
by samxxx
I am trying to clear the screen after I type something, not the whole screen just after I get a output.

Re: Screen clear function

Posted: Thu Oct 13, 2022 2:19 am
by Demivec
Do you have some sample runnable code showing things up to the point you have a question?

Re: Screen clear function

Posted: Thu Oct 13, 2022 2:32 am
by samxxx
This will just be an example:
PrintN ("Enter your name")

After I type a name how can I clear the screen after I hit enter.

Re: Screen clear function

Posted: Thu Oct 13, 2022 3:14 am
by idle
For console the command is ClearConsole()

Code: Select all

EnableExplicit 

EnableGraphicalConsole(#True)
Global firstname.s,lastname.s

OpenConsole() 

PrintN("Enter your first name") 
firstname.s = Input() 
ClearConsole()  
PrintN("Enter your last name") 
lastname.s = Input() 
ClearConsole() 
PrintN("Hello " + firstname + " " + lastname) 
Input() 
ClearConsole() 
Print("Done") 
Input() 

CloseConsole() 
End 

Re: Screen clear function

Posted: Thu Oct 13, 2022 9:22 am
by Olli
Hello samxxx,


you maybe send a small answer to the other subject you created. This helps to build the dialog.

It is also for you, to know the quality of the tool pureBasic.

Because there are several modes of interface.
- the normal console
- the "graphical" console
- the requesters (single questions and single answers in any standard windows)
- the standard GUI (graphic user interface) (no black background)
- the accelerated display (for 2D/3D)

So, do not hesitate to answer, what you like, and what it should be too complex for the moment.

Good coding !

Re: Screen clear function

Posted: Thu Oct 13, 2022 9:49 am
by infratec
If you are using a console output, you can simply send backspace characters to delete the line.
Or, if you use a graphical console: place the cursor at he beginning of the line and print spaces.
Or do you mean a real 'screen' (OpenScreen), then you can draw a box.

So you need to told us what exactly you mean with screen.
And if possible show us a working example.