The remainder of this page will highlight the main points which you should remember from this chapter, and on the next page you will get to try out your new knowledge in some exercises.
When you are writing an application that is to be used purely as a console application (for example, you are writing a command line/DOS/shell command like e.g. 'dir') you should make sure that you use the compiler option to create a console application.
You must always use the OpenConsole to open a console window before using the other commands in this library. Remember to also check that the console could be opened successfully.
You can only open one console at a time, although it is possible to close consoles when you no longer need them using the CloseConsole command (allowing you to open another one at a later point). If you have a console open when your program ends, PureBasic will close it for you automatically.
There are two commands for displaying text in the console, Print and PrintN. PrintN moves the cursor onto the next line after printing the text whereas the Print command does not.
There are two commands for getting input from the user. The Input command waits for the user to enter a line of text and the Inkey command checks to see if any keys are being pressed.
The appearance of the console can be changed in a number of ways, including the title of the window, colors, cursor size and position.
| Previous topic | Chapter contents | Next topic |
|---|---|---|
| Changing the appearance of the display | User Guide contents | Exercises |