Subject Re: Indexing issue
From Mervyn Bick <invalid@invalid.invalid>
Date Wed, 15 Nov 2023 14:00:03 +0200
Newsgroups dbase.getting-started

On 2023/11/14 19:47, Tom wrote:
> I am having an illegal key issue on my reindexing.wfm file.  The first line works fine, but the other 2 give me an illegal key on the field initial.
>
>     index on initial   tag except    for deleted() = false .and. exceptions = "X"
>     form.text4.text ='Reindexing Address File - "Bill From"'
>     index on initial   tag lessee    for deleted() = false .and. bill_from = "X"
>     form.text4.text ='Reindexing Address File - "Bill To"'
>     index on initial   tag lessor    for deleted() = false .and. bill_to = "X"
>

Did this work in the past and is now suddenly giving an error or is this
new code that is giving problems?

Back in the early days of dBASE, disk space was always at a premium and
it was important to try and keep files as small as possible so provision
was made to exclude deleted records from indexes.  With slower computers
it also made sense to do a SEEK on a smaller index file.  Today this is
not a problem.

It's been many years since I last used XDML so I may be wrong but you
shouldn't need to include deleted() = false in the FOR clause when you
create an index.  Although the index file may be a bit bigger the
deleted records will not display if you list, or display, the records in
the workarea.

Although the message is "Illegal key : initial" the problem is actually
in the FOR clause.  It's pennies to pounds that you have typos in the
field names in the two INDEX command statements.

Instead of creating multiple indexes to provide limited rowsets you
should consider having a simple index, with no FOR clause, on the
initial field and then use SET FILTER to limit the rowset to the records
for Exceptions, Bill_to and Bill_from.

Mervyn.