if..and..then question

lake

New Member
hi i have a w0 value and t changes as my programming runs and i and wondering if i can have 3 if's in one line of progrmming like
if w0=0 or 1 0r 3 and b0=2 then gosub...
or will i have to do it as three if's

oh and while ive got this post could someone tell me how to control the speed that it changes of
for b=0 to 9

line i need it to be the same speed all of the time and it has to be in a different subheading as i am running it in a dot matrix and it is the speed of a ball going along the screen so i carnt have a wait command or pause in it as it will slow the dot matrix effect and it wont appear to be on all of the time many thanks


Edited by - lakey009 on 22/06/2007 20:27:40
 

hippy

Technical Support
Staff member
You can put multiple AND and OR conditions in an IF-THEN but you have to play around to get it to work as expected if mixing AND and OR.

To change the rate of moving something within a loop, put a counter within the loop and only do something when the counter exceeds a particular value. You then need to rest the counter to zero to start again. This example updates a display every 10mS and moves a ball every 50mS, you'll have to adapt the idea to whatever you need ...<code><pre><font size=2 face='Courier'>Do
Gosub UpdateTheDisplay
Pause 10
counter = counter+1 % 5 ' 5 x 10mS = 50mS
If counter = 0 Then
Gosub MoveTheball
End If
Loop </font></pre></code>
 
Top