Topic: How does Vedit handle case switching? (1 of 4), Read 146 times
Conf: Converting, Translating
From: Fritz Heberlein
Date: Monday, January 25, 1999 05:57 AM

Could somebody please enlighten me how Vedit does handle case switching internally (built in translation table? other method?).
In its present state, it dislikes to switch umlauts and accented characters in a highlighted block.
Can you imagine a remedy or have i to set up an entirely new translation table?

Fritz

 


Topic: How does Vedit handle case switching? (2 of 4), Read 151 times
Conf: Converting, Translating
From: Christian Ziemski
Date: Monday, January 25, 1999 09:29 AM


I think VEDIT does it like that:
(in pseudo code)



// translate to upper
for(all characters in the block){
if((Cur_Char >= "a") && (Cur_Char <= "z")){
Cur_Char = Cur_Char - 32 // shift within the ASCII code
}
}

// translate to lower
for(all characters in the block){
if((Cur_Char >= "A") && (Cur_Char <= "Z")){
Cur_Char = Cur_Char + 32 // shift within the ASCII code
}
}



All other characters are distributed over the ASCII table without any order.
So it's not so easy to convert... :-(
And codes 128 to 255 are font dependent!


Maybe VEDIT works another way. But I would code it that way.


Christian

 


Topic: How does Vedit handle case switching? (3 of 4), Read 153 times
Conf: Converting, Translating
From: Fritz Heberlein
Date: Monday, January 25, 1999 09:57 AM

Christian:
what do you mean with "font dependent". Are you pointing to the differences between ascii and ansi only, or are there differences between ansi fonts, too?

If the first is true, we could work out your pseudo code and add an extra s&r sequence for "foreign" characters; if the second, i´m afraid we (or certainly me) are lost ...
Fritz

 


Topic: Re: How does Vedit handle case switching? (4 of 4), Read 162 times
Conf: Converting, Translating
From: Christian Ziemski
Date: Monday, January 25, 1999 12:17 PM


O.k. maybe I should have written:
"character set or codepage dependent"

Short summary: Don't trust the characters 128-255 !!!

I don't think there is an universal macro/translation possible.
(But fonts are not my profession! So: Let's wait for the pros.)

You have to check your text for the code values of the foreign
characters.

First translate the text with VEDIT's internal case_lower_block() or
case_upper_block().

Then add some global R()'s to the macro for all those code values.

That's stupid, I know. But that are PC's....


Christian