Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem about codepages with indexes
Message
De
24/03/2004 06:42:44
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
24/03/2004 05:21:00
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00889158
Message ID:
00889182
Vues:
17
This message has been marked as the solution to the initial question of the thread.
>I new behold this strange issue. My VFPs collate is turkish and codepage is 1254. My indexes and DBF files are normally.
>
>But when I use "create cursor" command and use "index on" command after that. My keys don't sort right. Turkish capitals throwed at end of the cursor (It normally when table has a codepage 437 but not normal in 1254)

Emre,
For the sake of keeping collation bugs away I don't use collate at all. Below are functions I use instead :
Function tupper
Lparameters tcStr
Return Upper(Chrtran(m.tcStr,'ýi','IÝ'))
EndFunc

Function tlower
Lparameters tcStr
Return Lower(Chrtran(m.tcStr,'IÝ','ýi'))
EndFunc

Function tCollate
Lparameters tcStr
Return Strtran(Strtran(Strtran(;
  Strtran(Strtran(Strtran(;
  tUpper(m.tcStr),;
  'Ð','G'+Chr(255)),;
  'Þ','S'+Chr(255)),;
  'Ý','I'+Chr(255)),;
  'Ö','O'+Chr(255)),;
  'Ç','C'+Chr(255)),;
  'Ü','U'+Chr(255))
endfunc
Test code :
Create Cursor test (Names c(20))
For ix=1 to 26
	Insert into test values (Replicate(Chr(Asc('A')-1+m.ix),5))
	Insert into test values (Replicate(Chr(Asc('a')-1+m.ix),5))
EndFor
Insert into test values (Replicate('ð',5))
Insert into test values (Replicate('ü',5))
Insert into test values (Replicate('þ',5))
Insert into test values (Replicate('ý',5))
Insert into test values (Replicate('ö',5))
Insert into test values (Replicate('ç',5))
Insert into test values (Replicate('Ð',5))
Insert into test values (Replicate('Ü',5))
Insert into test values (Replicate('Þ',5))
Insert into test values (Replicate('Ý',5))
Insert into test values (Replicate('Ö',5))
Insert into test values (Replicate('Ç',5))
index on tCollate(names) tag names
browse
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform