LOCATE allows you to print in a specific place on
the screen.
CLS LOCATE 5, 10 PRINT "Here" LOCATE 20, 70 PRINT "There"
The two numbers after LOCATE are the coordinates
where the print will be. Just like coordinates in
math class, these numbers give the row and the
column. The first number in LOCATE is the row, or
how far down the screen the print will start. The
second number is the column, or how far over the
print will start.
Let's use some random numbers, COLOR and LOCATE
to make a more interesting version of our first looping
program:
CLS DO Row = INT(RND * 23 + 1) Column = INT(RND * 79 + 1) LOCATE Row, Column Color1 = INT(RND * 15 + 1) COLOR Color1, 0 PRINT "Ted was here!"; LOOP
Kind of messy, but interesting.
How about a clock?
CLS DO LOCATE 1, 1 PRINT TIME$ SLEEP 1 LOOP
TIME$ is a special variable that contains the
current time. Press Break to stop.
Source: http://jpsor.ucoz.com |