Select Case range of values


Results 1 to 4 of 4

Threaded View

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


    Did you find this post helpful? Yes | No

    Wink

    Hi,

    Code:
    A VAR BYTE
    
    SELECT CASE A
    
    
        CASE IS > 5 AND IS < 20
            ' do your stuff...
        CASE IS < 40 AND NOT 35
                ' do your stuff...
    END SELECT
    could be Written

    Code:
    
    SELECT CASE A
    
        CASE IS <= 5 
    
        CASE IS < 20
            LCDOUT $FE,2, " < 20 " , DEC3 A
            
        CASE 35
    
        CASE IS < 40
            LCDOUT $FE,2, " < 40 " , DEC3 A
    
       CASE ELSE
    
    END SELECT
    CASE A left "blank" works fine...

    Alain
    Last edited by Acetronics2; - 25th June 2009 at 13:30.
    ************************************************** ***********************
    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. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Sony SIRC IR Issue
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th August 2015, 08:10
  3. Write Onewire data toa I2C memory / read ASCI
    By Eugeniu in forum mel PIC BASIC Pro
    Replies: 67
    Last Post: - 16th November 2008, 19:19
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  5. Interrupt/timer not really interrupting...
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd May 2005, 22:05

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