PDA

View Full Version : Problems with IF ENDIF



jetpr
- 2nd November 2005, 15:03
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

dmairspotter
- 2nd November 2005, 15:28
Could you explain what problem you are having with your code?

rhino
- 2nd November 2005, 15:52
Try re-writing them without the ()'s. Look at the PBP manual for different ways of using IF,Then, Else statements. Good luck!

Darrel Taylor
- 2nd November 2005, 16:10
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>