Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem about codepages with indexes
Message
From
24/03/2004 06:42:44
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/03/2004 05:21:00
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00889158
Message ID:
00889182
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform