When it is asked to process characters
ASCII 127 (characters that include what
Americans are pleased to call "foreign"
characters), it goofs badly ... though
I believe it has improved since it was
first released.
Here's what it produces, above ASCII
127. Characters within []s should
not be there. Characters within
][s should be there and are not.
[=83 florin]
[=93 opening curly quote]
=C1=C3
]=C0=C2=C4=C5=C6[
=C7
=C8=C9=CB
]=CA=8C[
=CD
]=CC=CE=CF[
=D1
=D3
]=D2=D4=D5=D6=D8[
[=D7 multiplication sign]
]=8A[
=D9=DB
]=DA=DC[
=DD
]=9F[
[=DF beta]
=E1=E2=E3=E5
]=E0=E4=E6[
=E7
=E9=EB
]=E8=EA=9C[
=EF
]=EC=ED=EE[
=F1
=F3=F5
]=F3=F4=F6=F8[
]=9A[
[=F7 addition sign]
=F9=FB=FC
]=FA[
=FD
]=FF[
[=FE ASCII 222, 'thorn' ... I think]
]=8E=9E[ ; cap and lc Z with inverted circumflex
; they print in MSWord and browsers, but
; not in MvTools, Notepad,
So here's a more reliable function. It runs just a
hair slower that the built-in isalpha(). On my
machine, for 30,000 iterations, the function body
needs 7.0 (+/- 1) seconds; isalpha() needs
6.5 (+/- 1) seconds.
<MvFUNCTION NAME =3D "isalphabeta" PARAMETERS =3D "Char">
<MvASSIGN NAME =3D "l.Allowed" VALUE =3D
"{'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu vwxyz=C1=C3=C0=C2=C4=C5=
=C6=C7=C8=C9=CB=CA=8C=CD=CC=CE=CF=D1=D3=D2=D4=D5=D 6=D8=8A=D9=DB=DA=DC=DD=
=9F=E1=E2=E3=E5=E0=E4=E6=E7=E9=EB=E8=EA=9C=EF=EC=E D=EE=F1=F3=F5=F3=F4=F6=
=F8=9A=F9=FB=FC=FA=FD=FF=8E=9E'}">
<MvFUNCRETURN VALUE =3D "{l.Char IN l.Allowed}">
</MvFUNCTION>
On the other hand, Miva's isdigit() returns true for
the following, in addition to 01234567890:
ASCII: 132 =3D =84
ASCII: 148 =3D =94
ASCII: 195 =3D =C3
ASCII: 197 =3D =C5
ASCII: 199 =3D =C7
ASCII: 200 =3D =C8
ASCII: 201 =3D =C9
ASCII: 209 =3D =D1
ASCII: 211 =3D =D3
ASCII: 213 =3D =D5
ASCII: 221 =3D =DD
ASCII: 223 =3D =DF
ASCII: 225 =3D =E1
ASCII: 226 =3D =E2
ASCII: 227 =3D =E3
ASCII: 233 =3D =E9
ASCII: 235 =3D =EB
ASCII: 237 =3D =ED
ASCII: 245 =3D =F5
ASCII: 247 =3D =F7
ASCII: 249 =3D =F9
So, unless you want to invent a
base-48 numbering system, and need some
of these characters for your notation,
you're better off with:
<MvFUNCTION NAME =3D "IsADigit" PARAMETERS =3D "Char">
<MvASSIGN NAME =3D "l.Allowed" VALUE =3D "{'0123456789'}">
<MvFUNCRETURN VALUE =3D "{l.Char IN l.Allowed}">
</MvFUNCTION>
The running times are about the same as for
the alpha functions, despite the much short
string assignment is IsADigit().
Jack
--=20
MvTools, a Miva/HTML editor -- FREE, at
http://papercitysoftware.com
Comment