Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Look what I foundout
Message
De
11/02/2000 13:59:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/02/2000 15:35:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00330296
Message ID:
00330904
Vues:
11
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform