| Subject |
Re: variable indexing problem. |
| From |
Andy Taylor <andy.taylor.1959@outlook.com> |
| Date |
Tue, 31 May 2022 05:42:12 -0400 |
| Newsgroups |
dbase.getting-started |
Hi Charlie,
You did the work by setting the variable idxname to a character string (which your table field is defined as).
the indexName property expects a character string (and also appears to ignore any trailing blanks)
('"'+trim(&idxname)+'"') failed because that evaluates the character string as "recno" and not recno.
Andy
> I was surprised to find the answer: is.indexname = idxname after trimming before.
>
> Charlie Wrote:
>
> > Trying to set up user defined which will be consistent even when the programmed is closed then open again. Tried everything in the book and I am close but need help.
> >
> > Storing the active index name in a memory table like this: im.fields["idx"].value = "recno"
> >
> > Recalling the index on-open like this: idxname = im.fields["idx"].value
> >
> > Afterward in on-open trying to set the index like this:
> > msgbox( '"'+trim(idxname)+'"' )
> > is.indexname = ('"'+trim(&idxname)+'"')
> >
> > Message box is for seeing what it looks like. And it looks exactly as if I used the hard index.
> >
> > This example gets variable undefined but I have had index doesn't exist with other variations. Can anyone suggest code that will work? Really appreciate any help!!
> >
>
|