Select case...Just wondering....


Results 1 to 6 of 6

Threaded View

  1. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    What about these?


    First one works for sure.
    Code:
    SELECT CASE x        
    
         CASE IS < 21   'Between 0 and 20; including 20.
    
         CASE IS > 20 AND IS < 41 'Between 21 and 40 ; including 21 and 40.
    
         CASE IS > 40 AND IS < 61  'Between 41 and 60 ; including 41 and 60.
    
    END SELECT

    For this second one, I expect someone to confirm.

    Code:
    'Once it hits the first matching condition it should not go to the next one.
    'Or will it?
    
    SELECT CASE x        
    
         CASE IS < 21 'Between 0 and 20; including 20.
    
         CASE IS < 41 'Between 21 and 40 ; including 21 and 40.
    
         CASE IS < 61 'Between 41 and 60 ; including 41 and 60.
    
    END SELECT
    Last edited by sayzer; - 29th December 2006 at 16:17. Reason: Added the second example.

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