If endif loop with 'OR'


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,672


    Did you find this post helpful? Yes | No

    Default Re: If endif loop with 'OR'

    Ah, what I posted should compile in C or PBP, and in both languages inner brackets should evaluate first, and in order toward outer brackets.

    C

    if (battery=charged) && (lightbulb != blown) { ‘ AND bulb will light }
    not really in C (battery=charged) is not a comparison it's an assignment ,while the statement will compile in C the results will be incorrect

    (battery==charged) is a comparison statement in C

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: If endif loop with 'OR'

    Whoops .

Similar Threads

  1. Exit from an IF/ENDIF loop with a GOTO
    By aratti in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 17th February 2014, 13:05
  2. Replies: 2
    Last Post: - 28th July 2011, 16:23
  3. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23
  4. Problems with IF ENDIF
    By jetpr in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd November 2005, 16:10

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