QBasic/Advanced Text Output

Cursor manipulation
As you try to write your text editor, you may realize that you will need to place the cursor in a given location on the screen. This is performed using the LOCATE statement.

Color
To change the current printing color, use the COLOR statement.

This can be used for title or status bars at the bottom.

Formatted printing
The PRINT USING statement allows you to output strings or numbers in a specified format. With this statement, you can write numbers out to specified decimal places or perform advanced output.

The most common format specifiers would be # and ., which reserve space for digits and decimal points respectively. You may also use the underscore to ensure that a given character is printed literally.

Note: PRINT USING is unable to add leading zeros to a number. E.g., if you specify 3 digits (###), a two digit number will be output with leading spaces.

Text animation
You require some time before doing a certain procedure. It is generally better to make an animation during the process which shows that the program has not hanged, but is going on. Why make that out of very complicated graphics? Use this: The program uses INKEY$, which you have not learnt yet, and SLEEP and DO...LOOP, which also you have not learnt. For more information, refer to Flow Control and Appendix.