QBasic/Advanced Text Output
From Wikibooks, the open-content textbooks collection
< QBasic
[edit] 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.
[edit] Color
To change the current printing color, use the COLOR statement.
COLOR 7,0 'Uses the default white on black. COLOR 15,0 'Bright white on black. COLOR 0,1 'Black on blue Color 14,0 'Bright yellow.
This can be used for title or status bars at the bottom.
[edit] 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.