Here are some ways to increase a variable ovetime. Note that the CLS and SET CURSOR and PRINT are not required for the increasing of the variable. Those are there so that you can see the variable's value as it increases. Basically what all of these small code snippets show is a variable increasing by 1 in a LOOP. LOOPS run the code inside of them over and over again, so by putting "inc x,1" or "x=x+1" inside of a loop, that will happen over and over again, thus gradually increasing the variable. In these examples, a DO loop was used. The loop starts at DO and ends at LOOP. There are many types of loops...
Increasing it by 1 overtime:
DO
cls
x=x+1
set cursor 10,10
print x
LOOP
Here's another way to do the above (Inc is a command that can be thought of as
INCREASE):
DO
cls
inc x,1
set cursor 10,10
print x
LOOP
Increasing it by 1 overtime, and not allowing it to go above 30 (I'll use the INC command, although x=x+1 would work just as well):
DO
cls
inc x,1
if x>30 then x=30
set cursor 10,10
print x
LOOP
Or making it go to 30 and then start over:
DO
cls
inc x,1
if x>30 then x=0
set cursor 10,10
print x
LOOP
And lastly, here is the variable increasing by 4 overtime:
DO
cls
inc x,4
set cursor 10,10
print x
LOOP
The examples may run a tad bit fast, so a SYNC ON and SYNC RATE at the top of your code is always helpful if you want the numbers to increase at a slower pace. Here's an example of that:
Sync On
Sync Rate 60
DO
inc x,1
if x>30 then x=0
set cursor 10,10
print x
Sync
LOOP
Another way to regulate the speed of the increasing variable is by using PresFox's sugguestion, but I don't think that should concern you yet.
Hope this helps