Page 1 of 1 1
Topic Options
#77818 - 2001-05-13 11:16 AM UCASE and LCASE
JensKalski Offline
Starting to like KiXtart

Registered: 2000-12-13
Posts: 186
Loc: Germany
Hello,
I've tested the UCASE and LCASE functions with the german special lower characters ,,, and the upper characters ,, with the little Kix
code:
$TextK = "abcdefghijklmnopqrstuvwxyz"
$TextG = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

CLS
BREAK ON
? $TextK
? UCASE($TextK)
? $TextG
? LCASE($TextG)
?


and got as result the following lines:

code:
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz

The second line is only incorrect in . For there is no upper character.
Also the fourth line is incorrect in .

My only question is: Is it a bug or a NON-FEATURE for non-english languages. If it is last I think it will be a good idea to write it into the documentation.

Whats about other languages than german that have special characters?

------------------
Jens Kalski
eMail: jens@kalski.de

[This message has been edited by JensKalski (edited 13 May 2001).]

_________________________
Jens Kalski

Top
#77819 - 2001-05-14 01:02 AM Re: UCASE and LCASE
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Ich spreche nicht Deutsche, aber... I didn't know there was a capital .

Have a look at this port. It shows a set of cases of 'a'='A' that might contain all the extended character sets that you are looking for. It might not, but it might give you some ideas.

Using the ideas in that post, I wrote a test script:

German.kix

code:

BREAK ON
CLS


$=setascii("off")
$TextK = "abcdefghijklmnopqrstuvwxyz"
$TextG = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"


"source kleine" $TextK ?
"enlarge kleine" UCASE($TextK) ? ?
"source grosse " $TextG ?
"shrink grosse " LCASE($TextG) ? ?


"little:" ?
chr(228) " " 256+asc("") ?
chr(246) " " 256+asc("") ?
chr(252) " " 256+asc("") ? ?


"big" ?
chr(196) " " 256+asc("") ?
chr(214) " " 256+asc("") ?
chr(220) " " 256+asc("") ? ?


"sz" ?
chr(223) " " 256+asc("") ? ?


"subs" ?
"A-a=" 228-196 ?
"O-o=" 246-214 ?
"U-u=" 252-220 ? ?


"comps" ?
if chr(228)=chr(196) "A=a" else "A<>a" endif ?
if chr(246)=chr(214) "O=o" else "O<>o" endif ?
if chr(252)=chr(220) "U=u" else "U<>u" endif ? ?


This shows that KiX (3.63 and 2001 beta 2a) believe that = and the difference of 32 corresponds with my discoveries in that aforementioned post. I hope I have helped in some way...


cj

p.s. Kix2001 beta can distinguish between and with == instead of =

------------------
For more scripts goto cj's scripts page


chrismat@ozemail.com.au

Top
#77820 - 2001-05-14 01:09 AM Re: UCASE and LCASE
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
More testing...
This is with KiX2k Beta 2a...

german2.k2k

code:

break on
cls


for $i=128 to 255
$i ": " lcase(chr($i)) " " ucase(chr($i)) " "


if lcase(chr($i))==ucase(chr($i))
"equal"
else
"not equal"
endif
?


next


That script produces this output:

code:

128: equal
129: equal
130: equal
131: equal
132: equal
133: equal
134: equal
135: equal
136: equal
137: equal
138: equal
139: equal
140: equal
141: equal
142: equal
143: equal
144: equal
145: equal
146: equal
147: equal
148: equal
149: equal
150: equal
151: equal
152: equal
153: equal
154: equal
155: equal
156: equal
157: equal
158: equal
159: equal
160: equal
161: equal
162: equal
163: equal
164: equal
165: equal
166: equal
167: equal
168: equal
169: equal
170: equal
171: equal
172: equal
173: equal
174: equal
175: equal
176: equal
177: equal
178: equal
179: equal
180: equal
181: equal
182: equal
183: equal
184: equal
185: equal
186: equal
187: equal
188: equal
189: equal
190: equal
191: equal
192: not equal
193: not equal
194: not equal
195: not equal
196: not equal
197: not equal
198: not equal
199: not equal
200: not equal
201: not equal
202: not equal
203: not equal
204: not equal
205: not equal
206: not equal
207: equal
208: not equal
209: not equal
210: not equal
211: not equal
212: not equal
213: not equal
214: not equal
215: equal
216: equal
217: equal
218: equal
219: equal
220: equal
221: equal
222: equal
223: equal
224: not equal
225: not equal
226: not equal
227: not equal
228: not equal
229: not equal
230: not equal
231: not equal
232: not equal
233: not equal
234: not equal
235: not equal
236: not equal
237: not equal
238: not equal
239: equal
240: not equal
241: not equal
242: not equal
243: not equal
244: not equal
245: not equal
246: not equal
247: equal
248: equal
249: equal
250: equal
251: equal
252: equal
253: equal
254: equal
255: equal

Now you can see what characters KiX will change with UCASE/LCASE.


cj

Top
#77821 - 2001-05-15 12:19 AM Re: UCASE and LCASE
JensKalski Offline
Starting to like KiXtart

Registered: 2000-12-13
Posts: 186
Loc: Germany
I think you are absolutely right cj. But the question is: What for do I need UCASE or LCASE if I must write routines or functions to expand them to a form that I need. I think I then must program my own UpperCase- and Lowercase-Functions and forgot UCASE and LCASE

------------------
Jens Kalski
eMail: jens@kalski.de

_________________________
Jens Kalski

Top
#77822 - 2001-05-14 02:10 PM Re: UCASE and LCASE
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Here you go:

These are replacements for LCASE and UCASE.
Here is the full UDF Spec:

code:

cjLCASE
Author
cj (chrismat@ozemail.com.au)


Action Equivalent to KiX function LCASE, but with support for extended language characters.


Syntax CJLCASE(string)


Parameters string

Required string to be changed to lowercase.


Returns The input string in lowercase.


Remarks Supports extended characters like and .


Examples $word=cjLCASE("CLICH")


Source
Function cjLCASE($x)
dim $y, $z
for $i=1 to len($x)
$y=asc(substr($x, $i, 1)) ; get next char
$z=$y ; set default
if $y<1 $y=$y+256 endif ; support for negative numbers from ASC()
if $y>64 and $y<91 ; normal char set
or $y>191 and $y<222 ; extended char set
$z=$y+32
endif
if $y=254 $z=222 endif ; special case
$cjLCASE=$cjLCASE+chr($z)
next
EndFunction


and

code:

cjUCASE
Author
cj (chrismat@ozemail.com.au)


Action Equivalent to KiX function UCASE, but with support for extended language characters.


Syntax CJUCASE(string)


Parameters string

Required string to be changed to uppercase.


Returns The input string in uppercase.


Remarks Supports extended characters like and .


Examples $word=cjUCASE("resum")


Source
Function cjUCASE($x)
dim $y, $z
for $i=1 to len($x)
$y=asc(substr($x, $i, 1)) ; get next char
$z=$y ; set default
if $y<1 $y=$y+256 endif ; support for negative numbers from ASC()
if $y>96 and $y<123 ; normal char set
or $y>223 and $y<254 ; extended char set
$z=$y-32
endif
if $y=222 $z=254 endif ; special case
$cjUCASE=$cjUCASE+chr($z)
next
EndFunction



cj

------------------
cj's scripts page
cj's User Guide - 14 May 2001

chrismat@ozemail.com.au


[This message has been edited by cj (edited 14 May 2001).]

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1160 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.053 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.