Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
J and J
Message
From
17/09/2004 08:21:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/09/2004 06:43:40
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00942813
Message ID:
00943276
Views:
14
Hayir olmayacak. Basit mantik siralama icin once hersey upper() ki bu isin A a kismini halletsin.
Sonraki problem ç nin c ile d arasinda yer almasi. ç yerine 'c'+chr(asc('z')+1) olunca o da halloluyor. Yani gene c ile baslayanlar geliyor ama normal c'lerden sonra. Sadece Turkce karakterlerin oldugu yerler 2 byte oldugundan fazla genisleme problemi de yok (VFP,general,unicode gibi tum karakterleri 2 katina cikarmiyoruz).
Fox4um'da ornek kodlari yazmistim Tarkan'la ilgili bir mesajdaydi galiba.
Cok da problem degil rapor icin almak:

select *,tupper(myField) as Sorter from myTable ;
where tupper(myField) between 'A' and 'C' ;
order by sorter && A - Ç

select *,tupper(myField) as Sorter from myTable ;
where tupper(myField) between 'A' and 'CZ' ;
order by sorter && A - C

eger tupper() indexın varsa hız da problem olmuyor ) benim yillardir :
tupper(First+Last) ve tupper(Last+First) indexlerim var.

galiba sys(15) di mapping yapiyor o da efektif numara.

Bir baska basit numara indexte dogrudan harfler yerine o harflerin alfebedeki sirasini kullanip (sadece biraz daha okunabilir olsun diye) 64 filan eklemek:
#Define Alphabet "ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ"
? IndexExpr('çetin başöz')
? IndexExpr('Çetin baŞÖz')

? IndexExpr('cetin baŞÖz')
? IndexExpr('çetin başöz')
? IndexExpr('detin baŞÖz')

Create Cursor myTest (myName c(20))
Insert Into myTest Values ('çetin başöz')
Insert Into myTest Values ('ibrahim çetin başöz')
Insert Into myTest Values ('cemil')
Insert Into myTest Values ('ıtır')
Insert Into myTest Values ('iskender')
Insert Into myTest Values ('özgür')
Insert Into myTest Values ('osman')
Insert Into myTest Values ('şakir')
Insert Into myTest Values ('salim')
Insert Into myTest Values ('ülgen')
Insert Into myTest Values ('ulaş')
Insert Into myTest Values ('vezir')
Insert Into myTest Values ('remzi')
Insert Into myTest Values ('gül')
Insert Into myTest Values ('ğül :)')
Copy To Array auppers
For jx=1 To Alen(auppers,1)
    auppers[jx,1] = tupper(auppers[jx,1])
Endfor
Append From Array auppers

Select myName, IndexExpr(myName) As Sorter ;
    from myTest ;
    order By Sorter

Select myName, IndexExpr(myName) As Sorter ;
    from myTest ;
    where IndexExpr(myName) Between IndexExpr('A') And IndexExpr('Ç') ;
    order By Sorter




Function IndexExpr
    Lparameters tcStr
    tcStr = tupper(m.tcStr)
    Local ix,lcStr
    lcStr=''
    For ix=1 To Len(m.tcStr)
        lcStr = lcStr + Chr(64+At(Substr(m.tcStr,m.ix,1),Alphabet))
    Endfor
    Return m.lcStr

Function tupper
    Lparameters tcStr
    Return Upper(Chrtran(tcStr,'ğşıi','ĞŞIİ'))
Cetin



>Ama þimdi o zaman da þöyle bir sorun olmayacak mý? bir rapor alýnacak. kullanýcý a ve ç arasýný liste almak istedi. bu durumda program herkesi verir. öyle deðil mi? bu durumlar için fonksiyon da kullanmak istemiyorum. galiba ben böyle j ve de ý harflerinin problemlerini kabullenip devam edicem...
>
>>Metin,
>>You never need to use Turkish collate. Check fox4um - search with keywords like tupper,index,collate.
>>Cetin
>>
>>
>>>Bad news, :(
>>>
>>>I have to use Turkish collate...
>>>
>>>Thanks,
>>>
>>>>> I reveal at testing ;
>>>>> "j"="J" gives true result.
>>>>>
>>>>> It give that result with Foxpro dos and VFP... I amazed how I didn't reveal
>>>>> that and I'm wondering why?
>>>>
>>>>Does it depend on your current Collate setting ?
>>>>
>>>>SET COLLATE TO "MACHINE"
>>>>? "j" = "J"   && .F.
>>>>SET COLLATE TO "GENERAL"
>>>>? "j" = "J"   && .T.
>>>>
>>>>
>>>>hth
>>>>-Stefan
Ç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