Addindex -> invalid descriptor Help (Delphi 1)

vd...@let.rug.nl (W.J. van de Vis) wrote:

Quote
>Hi,
>when I use Addindex to add an index that consists of more than one field, it
>raises an exception 'invalid index descriptor', even when I COPY the example
>from the help file.
>Addindex DOES work with ONE field name.
>So:
>    table1.Addindex('Newindex', 'NAME', [])
>does work and
>    table1.Addindex('Newindex', 'NAME;SIZE', [])
>doesn't. (in E.G. ANIMALS.DBF)
>If you have a solution for this, please reply to my emailaddress as well.
>Thanks!!
>Willem.
>//==============================================================\\
>|| Willem van de Vis             Alfa-Informatica               ||
>|| vd...@let.rug.nl              http://www.let.rug.nl/~vdvis   ||
>|| Groningen, the Netherlands    Whoever reads this can read.   ||
>\\==============================================================//

Hello Willem,

I don't know if this is still of any use to you but I was looking for
an answer on this very same question in the newsgroups and I thought
you still might want to know tha answer. I know it is rather late but
here is the solution I came up with:

        table1.Addindex('Newindex', 'NAME;SIZE', [ixExpression])

ixExpression is not documented. According to some other iformation I
found you can also use :

 Table1.AddIndex('FullName', 'LastName + FirstName', [ixExpression]);

However, this gives me the same error as before :  

'invalid index escriptor'

I hope you can use it.

Regards, Steve