| 16 Storm - Guide |
While Mallard BASIC doesn't have any built-in commands to clear the screen or position the cursor, you can easily create them yourself.
To clear the screen, you need to create a variable that holds the information needed to clear it. The best way is to set up a string variable and put the clear-screen codes into it, as follows:
cls$=CHR$(27)+"0"+CHR$(27)+"E"+CHR$(27)+"H"
Note here that the 0 after the CHR* is a zero, not a letter O. Now, the string variable cls* contains the data needed to clear the screen. So, to actually clear the screen in your program, you have to print the string. Take a look at this example:
40 PRINT cls$
Here, when the program reaches line 40 it will clear the screen. Remember to set up the cls* variable - the one we created in the first example - before you try to print it, though.
In our next guide, coming soon on 16 Storm, we'll create some commands to position the cursor anywhere on screen, and look at how to turn the cursor on and off.
| Back to main page |