>did you know that you can create an index using your own functions. Example: index on MYFUNCTION(vfp_expression) tag mytag
>
>where MYFUNCTION is a function you create. Or did y'all already know this.
Dean,
I couldn't browse the whole thread and here is my .2 cents.
"Generally" if possible you shouldn't do it. But I disagree with the ideas that it should "never" be done. I actually do it since fox wasn't yet bought by MS and still do. My case however is something that in VFP still you can't do w/o it (exceptional to our language - windows still cannot correctly upper or lower 2 chars in our alphabet). I also offend the idea if UDF is not found the table cannot be opened or index get corrupt (but a kind of corruption). What fox simply does is to quote your key expression. e.g :
If you create this tag :
index on myUDF(somefield) tag myTag
And fox cannot find it, index becomes as if you created it :
index on "myUDF(somefield)" tag myTag
which has all the same value for all records :) This is a kind of corruption but not a disaster one. Simply index order is same as physical order. If as a developer you just have it as a "stored procedure" (thanks to VFP) then it's there to find. In old days what I do was to keep the function as an fxp in path. This prevents index pseudo corruption when it's opened from outside of app :)
BTW this index "corruption" could be considered as a little tip/trick for another purpose :)
index on "1" tag myMoveFast
provides a fast "go top", "go bottom" :)
Cetin