Print something out, whatever, in quotes
PRINT "Hello World!"
Select foreground and background colors;
fore = 0-31
back = 0-7
COLOR 12,3 This sets the colors to be light red on cyan;
COLOR ,5 This sets the background to magenta, whileleaving the foreground alone;
Note that these only take effect on subsequent PRINTs;nothing is changed on the current screen.
Clear the screen to the current background color
Move the cursor to a particular row, column
row = 1-25
col = 1-80
LOCATE 5,40 This places the cursor in row 5, column40;
Specify a character whose ASCII codeis n
PRINT CHR$(3) This will print out a heart;
*** Nifty Alternative ***
For the extended graphics set (namely characters 128-255) you can usethe following method to display the character right in your program!
Hence, if you want to use the Greek letter beta (ASCII 225), you woulddo this:
Hold down [Alt]
Press [Keypad 2], [Keypad 2], [Keypad 5]
Note that this only works within DOS; it does not work in Windows.
Carries out a task any number of times
FOR n = 1 to 15 COLOR n PRINT "Color"; nNEXT n
This prints out the numbers 1 through 15 in their respective colors;
This allows you to create re-usable subroutines, for example:
PRINT "Here is a test..."GOSUB 1000 PRINT "I'm back now."END1000 'Subroutine PRINT "Here I am in the subroutine!" RETURN