Logical Operators


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default Logical Operators

    Can PBP support more than 2 inputs for an AND command?

    example:

    if x=0 AND y=0 AND z=0 then DoThis

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Yes PBP can do that.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes, and make sure you add some parenthesis to make sure.

    Code:
    IF (X=0) AND (y<8) AND (z>4) ...
    now depending where x,y,z come from, there's a few way to avoid multiple AND.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Ok, what I'm doing is using 2 inputs for 3 switches. One connected to portb1, another to portb.2 and the last one is connected to two diodes cathodes with there anodes connected to portb.1 and portb.2. Works fine is the parentheses. Doesn't work too good without them though.

Similar Threads

  1. decoding quadrature encoders
    By ice in forum mel PIC BASIC Pro
    Replies: 93
    Last Post: - 28th February 2017, 09:02
  2. Logical vs Bitwise ==
    By Archangel in forum General
    Replies: 7
    Last Post: - 19th February 2010, 06:22
  3. Conversion to degrees help
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 5th September 2008, 18:03
  4. New to PICBASIC Pro and have simple question
    By plyrathrt in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 22nd January 2008, 15:26
  5. Bitwise Operators
    By SterlingY in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th March 2007, 05:57

Members who have read this thread : 1

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