Index Select Lists (AREV Specific)
At 01 FEB 2007 01:48:08PM Terry Rainville wrote:
Selecting records from a btree index (Field not symbolic)
SELECT table WITH FIELD=?
Results when using the EDIT table command are as follows.
EDIT table
1111111
1
2222222
1
3333333
1
4444444
1
Record #1 does not exist but the index is returning this anyway
after each real hit. Anyone know what this is about ??
At 01 FEB 2007 03:48PM Richard Hunt wrote:
Not too sure about this… Is it possible that the "1" is really a multivalue position? If the selected field is multivalued then the string returned by a "READNEXT" sentence would be KEY in value 1 and VALUE in value 2. Or it would look like this KEY:@VM:VALUE
At 01 FEB 2007 10:01PM Gray Cunningham wrote:
I was able to duplicate this, but I my select was on a multi-valued field (as defined in the dictionary) and I had to use the "BY-EXP" modifier. In this instance, the behaviour you described is what I would expect to see…if you didn't use the "BY-EXP" modifier, I am not sure what would cause it.
At 02 FEB 2007 11:13AM Victor Engel wrote:
Instead of performing an EDIT after the select, try saving the list. Now edit the list. I think you will notice that the list looks like this:
1111111²1
2222222²1
3333333²1
(in case the superscript 2's don't get processed properly by this form, see below)
1111111.1
2222222.1
3333333.1
where the periods are really superscript 2s.
In order to process such a list properly, the extended readnext syntax must be used:
READNEXT RECORD_KEY,WHICH_VAL THEN/ELSE ….
If the WHICH_VAL part of the syntax is omitted, then READNEXT will read only to the next marker, which is a value marker. The next time it will read until the next marker again and will get only the value number.
Evidently, the EDIT program doesn't use the extended syntax (it makes sense, if you think about it).
Victor