Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Croatian collating sequence for VFP9
Message
De
06/10/2006 10:59:12
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
06/10/2006 09:17:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01159662
Message ID:
01160057
Vues:
14
>Hi Mr. Nedeljkovich,
>Thanks for your answer. I had set Collate to "SLOVAK" and created new table and populated with new data. After building index on field lastname (containing national characters) and issuing SET ORDER order in browse window is again confusing (CodePage od DB is 1250) beacuse lower case are between uppercase and also in no proper order. Then I tried this:
>
>gcTranslationExpression =""
>for i = 0 to 255
>gcTranslationExpression=gcTranslationExpression+chr(i)
>next i
>gcTranslationExpression=chrtran(gcTranslationExpression,;
>"ČĆĐŠŽZ","CCDSY")
>save to gcTranslationExpression
>RESTORE FROM curdir() + 'gcTranslationExpression' additive
>and table is indexed by:
>USE TEST3 EXCLUSIVE
>INDEX on SYS(15,gcTranslationExpression,prezime) TAG baprez
>REINDEX
>SET ORDER TO tag baprez
>BROWSE
>
>but it order field prezime (only upper case is used) properly only if it contain only one letter; if you add full lastname they are loosing order. Realy weird. Very strange that in so mighty VFP9 has no easy solution for more than 25 mil. citizens :(
>In any way, thanks you for your fast response.

That's the way other collating sequences are done - they are case blind. Under Set("collate")="SLOVAK" (or SWEFIN or any of those), just try comparing strings, you may be in for several surprises. Which is why I don't Set Collate anymore - it's always Machine; I just build the needed indexes with those sequences.

The sys(15) solution is fragile, though - if you ever lose the .mem file you'll get a nasty error. I'd rather do build the string just like you did somewhere in the startup of your app, and store it in a custom property of _screen, and use that in the sys(15). Easier to maintain code than an extra file, IMO.

Also, when you open such a table from the command window, if the gcTranslationExpression is not there, you get the error (variable not found - 12).

I wish we had a tool to build our own collate sequences.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform