PDA

View Full Version : Select Case



Srigopal007
- 20th June 2005, 18:37
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

Dwayne
- 20th June 2005, 19:18
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