-
Problems with IF ENDIF
Example_1:
Steps=100
Step=0
RPM_MAX=160
RPM=55
while (Step< Steps)
Step= Step+ 1
IF (RPM < RPM_MAX) Then ' One time the RPM get to the MAX RPM the if shut not get in
Pump_DC = (Scale / 100 * Step+ Pump)
Pause 100
ENDIF
RPM=RPM+6
wend
Example_2:
Step=0
RPM_MAX=160
RPM=55
for x=1 to 100
Step= Step+ 1
IF (RPM < RPM_MAX) Then ' In this Case with for next Work
Pump_DC = (Scale / 100 * Step+ Pump)
Pause 100
ENDIF
RPM=RPM+6
next x
-
Could you explain what problem you are having with your code?
-
Try re-writing them without the ()'s. Look at the PBP manual for different ways of using IF,Then, Else statements. Good luck!
-
jetpr,
I'm not sure how you even got this to compile.
STEP is a reserved word. Part of the FOR/NEXT syntax.
Try using a different variable name.
<br>