Thanks Eric,
I bet my question sounds silly.
The thing is, I do not want to re-generate the index again. I just need to run index with field1 once but change it to field2 without indexing again.
I am not sure whether by deleting tag and perform index on field2 will run index again.
Accept my apologises if I have confuse all of you.
Let me explain what I am trying to do.
I am using a index progress bar function
use myTable
index on progressbar(field1) tag tag1
function progressbar
lparameters cField1
wait window at 10,10 'indexing '+transform(recno())+' of '++transform(reccount())
return cField1
endfunc
The problem is, the return value is not field1. So, the index expression after indexing is 'index on progressbar(field1) tag tag1' instead of field1. So, I need to code to alter the expression to field1.
Using such index expressions will slow down your app and your table and index access/updates dramatically. I'd never use it. It does not make an app better.
Can I have one question that is related to this thread?
In my application I have database. After some time I need to add one more index to table. Because there are more then one PC that use this application so I wont to do it in function that will be run on application startup.
But when I do this:
open database db
use table1
index on filed10 tag tag10
index on filed11 tag tag11
close tables
close database
But after I modify table in database builder so there isnt the new indexes that I tried to create. Where is the problem? Sometimes I get error hat database isn't validate.
Than I have to repair it in VFP designer.
i12hvfun,
I agree with Eric, that it would likely take a great deal of extra time to create this index. Have you considered just turning the TALK setting on and an having an appropriate ODOMETER value? This will show that the reindexing is going on, without slowing things down quite so much.
On the other hand to "answer" your original question, you'll need to close the table (and the index), and use the low-level IO routines (FOPEN, FSEEK, FWRITE, FCLOSE) to alter the index expression value in the .CDX header. It's clearly defined in the VFP documentation, but I hesitate to give you the exact code, because I consider it a potentially bad kludge.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.