Multiple IF-THEN statements


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Post one test only version ...

    Hi,

    May be we could simplify ...

    RTCSEC is ALWAYS >= 0 with PbP ... huh ...


    IF ( RTCSEC & $F0) = 0 or 3 ... AND
    IF RTCSEC & $0F < 8 ... PortB.7 = 1

    Else Portb.7 = 0

    so,

    IF (( rtcsec & $F0 = 0 ) OR (rtcsec & $F0 = $30 )) AND ( rtcsec & $0F < 8 ) THEN
    PORTB.7 = 1
    ELSE
    PORTB.7 = 0
    ENDIF

    ...


    Alain

    PS: Hi Sayzer ... you've also got one point !!!
    Last edited by Acetronics2; - 19th June 2007 at 12:52.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Multiple PICS from Same Crystal?
    By WOZZY-2010 in forum General
    Replies: 2
    Last Post: - 6th February 2010, 15:18
  2. Multiple RETURNS within a single subroutine
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st June 2009, 16:43
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  4. Multiple SERIN's
    By JoeR in forum mel PIC BASIC
    Replies: 4
    Last Post: - 6th October 2005, 22:22
  5. Multiple IR LEDs from 1 port using transistor
    By belpe123 in forum General
    Replies: 3
    Last Post: - 20th May 2005, 22:07

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