Re: Small feature request for future EU versions

new topic     » goto parent     » topic index » view thread      » older message » newer message

What I think he means is this:

constant  LA_up= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
constant LA_lo = "abcdefghijklmnopqrstuvwxyz"
constant LA_diff = LA_up - LA_lo

global function case_LA(integer c, object x)
    integer n
    if atom(x) then
        if c then
             n = find( x, LA_lo )
             if n then
                  x += LA_diff[n]
             end if
        else
             n = find( x, LA_up )
             if n then
                  x -= LA_diff[n]
             end if
         end if
     else
         for i = 1 to length(x) do
             x[i] = case_LA(c, x[i])
         end for
     end if

      return x
end function

> I like your suggestion, but I just do not see the solution how to make
> this way the stable templet for *any* alphabet now.

Works for any alphabet and code page, and is faster, because it
doesn't have to keep slicing the alphabet sequences.

> Some alphabets have no case at all, some alphabets have different
> numbers of upper and lower letters.
> For example, computer Russian has 3 extra letters in upper case, which
> are absent in Russian canonical grammar.

The limitation of the above function is that LA_up and LA_lo must be
the same length... what do you mean by 3 extra letters? What if you
try to convert them to lower case? If it should just leave them as
upper case, that's fine - just leave them out of the function.

 
***The above function is completely untested. It should not be used in
nuclear reactors, medical life support systems, or anywhere where
failure may cause injury*** smile
-- 
MrTrick

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu