PDA

View Full Version : LookDown2 question



DynamoBen
- 3rd November 2005, 02:51
In the first example var=1. In the second example var=0. I don't understand why the table isn't being search when I use variables. Thoughts?

This works:

Value=$5C
LookDown2 Value,[$FF,$5C,$41],Var

This doesn't:
Zero=$FF
First=$5C
Second=$41

Value=$5C
LookDown2 Value,[Zero,First,Second],var

DynamoBen
- 4th November 2005, 14:43
*bump*

Sorry I really need some resolution on this issue.

rhino
- 4th November 2005, 15:56
In your first example, var = 1 is correct, since it is the second value in the list. As for the second example, I've got to assume that var = 0 since "$5C" is not in the list and var is already 0? The manual says if the search value is not found, then var is unchanged. Have you tried setting var to a known value then run through the second example and see if it changes? Just an idea. Good luck!

DynamoBen
- 14th November 2005, 22:07
I think the issue is that you can't use a variable as a value.

The manual reads as follows:
"Array variables with a variable index may not be used in LOOKDOWN2 although array variables with a constant index are allowed."


To me this means you can't do B0[1] but you can do B0. I'm I thinking wrong?

Any help is appricated. Basically I have a list of 7 values in EEProm I need to compare to a calculated variable.
Basically the functionality of LookDown with EEProm variable in the list.

rhino
- 15th November 2005, 13:36
The first example in the manual uses a variable in the value list.
LOOKDOWN2 W0,[512,W1,1024],B0 My question is will it work if your values in the list are constants?

DynamoBen
- 15th November 2005, 14:14
I will try constants and post my results.

rhino
- 23rd November 2005, 15:51
Had any luck?

DynamoBen
- 23rd November 2005, 15:59
I have not tested the theroy yet.

I'm currently trying to iron out some ICSP issues. I will post once I have some resolution.

DynamoBen
- 16th February 2006, 23:17
I sent my question over the MELAB. Both examples worked properly for him. I guess I have problems elsewhere. I will keep searching.