Problems with IF ENDIF


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133

    Question 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
    Last edited by jetpr; - 2nd November 2005 at 16:38.

  2. #2
    Join Date
    Oct 2005
    Posts
    28


    Did you find this post helpful? Yes | No

    Default

    Could you explain what problem you are having with your code?

  3. #3
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Lightbulb

    Try re-writing them without the ()'s. Look at the PBP manual for different ways of using IF,Then, Else statements. Good luck!
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    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>
    DT

Similar Threads

  1. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 06:28
  2. Complete Keypad Example
    By T.Jackson in forum Code Examples
    Replies: 18
    Last Post: - 27th July 2011, 19:09
  3. Making a menu
    By chrisshortys in forum mel PIC BASIC Pro
    Replies: 36
    Last Post: - 12th November 2008, 19:54
  4. Help needed with Select Case?
    By jessey in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd January 2008, 00:12
  5. shifting problem
    By helmut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st August 2007, 06:11

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts