Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simulating EBCDIC sort with vfp index
Message
From
31/01/2001 22:25:00
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00470093
Message ID:
00471072
Views:
50
>>I seem to remember something like sys(15), which actually needs a 256-character string and performs an equivalent of chrtran() on your key, but we did use that to achieve our national collationg sequence back in foxplus days. The only trouble is 1) you have to build this translation string, and 2) it needs to be in memory whenever you try to open the table using such a key.
>>If that's OK with you, index on sys(15,your_field, your_tran_string) tag yadayada, or something like that.
>
>Thanks Dragan, you got me thinking in the right direction, I had to map out 1-1 sequence of ASCII to EBCDIC that would give a proper sort translation. This is about the ugliest index I can ever recall seeing, but it seems to work in preliminary testing:
>
>INDEX ON CHRTRAN(myfield,'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz','qrstuvwxyzabcdefghijklmnopQRSTUVWXYZ !#$%&()*+ABCDEFGHIJKLMNOP') TAG mytag
>
>Other translation sequences are possible, but this one seemed especially ugly, so what the heck, might as well have some fun coding :-) Have to test a little more, though...

This is still nice - the fun will begin once you get to write the first Seek() using that tag :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform