Select Case


Closed Thread
Results 1 to 2 of 2

Thread: Select Case

  1. #1
    Join Date
    Jul 2004
    Location
    CA
    Posts
    78

    Default Select Case

    Hi All, I want to store more than 256 values into a lookup table. I have browsed through the PBP manual and found that there is a command for storing values into a lookup table called (Lookup Index,[List of 256 Bytes])

    My problem is that I need to store more than 256 bytes using the LookUp Command. Here is what I was thinking of doing... Use the Select Case Function to increase the number of Values.

    I have contacted the support line at Melabs and they recommend that I do the following.

    Index Var Word
    Select Case Index.HighByte
    CASE 0
    LookUp Index.LowByte,[List of 256 Bytes]
    CASE 1
    LookUp Index.LowByte,[List of 256 Bytes]
    CASE 2
    .....

    End Select


    Now my question is how does the program know to switch from Case0 to Case1? How does the program know what CASE to pick next?
    Can anyone help me with this please. Thanks

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Now my question is how does the program know to switch from Case0 to Case1? How does the program know what CASE to pick next?


    In your example the Variable Index.HighByte is what it looks at... If Index.HighByte is equal to 0 then in will do the CASE 0;
    If Index.HighByte = 1 then it will do Case 1... etc.

    Each time it runs the routine, it looks at the value of Index.HighByte. Then it goes down all the cases you have listed and compares Index.HighByte to the case....If it is equal, then it will do that case, and ignore all others.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

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. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  4. select case question
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th March 2006, 10:01
  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 : 2

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