Home
Forum: "Main";
Current archive: 2002.01.08;

Down

#### Good day Find similar branches

Dmitry1   (2001-12-14 16:53) [0]

How to determine if there are Cyrillic characters in the drain?
You can convert the question a little:
how to determine what is in the line only: latin letters and service signs

Mick   (2001-12-14 16:56) [1]

Did you try to compare the characters of this line with the characters of the Cyrillic alphabet?

Dmitry1   (2001-12-14 17:01) [2]

this can certainly be done, but I'm afraid it will work for a long time. I have more than 2000 lines that need to be processed. : ((

Mick   (2001-12-14 17:05) [3]

8086 processor? So he is quite capable of it.

Dmitry1   (2001-12-14 17:11) [4]

But what special function is not there?

Mick   (2001-12-14 17:15) [5]

There is such a function!
Her last name If

Dmitry1   (2001-12-14 19:42) [6]

I asked about the API functions. : ((And in your solution to the problem, it’s better not to if apply and homes since the type char is enumerable.
I need the Api function in order to work with encodings correctly.

Tonie   (2001-12-14 19:46) [7]

the line has no sign of encoding, so really you just need to go along the line and check the character code for belonging to the Latin alphabet like: "A" .. "Z", "a" .. "z": Result: = inLatin

Mick   (2001-12-14 19:48) [8]

And than for example this:
`if MyString [i] in ["A" .. "i"] then ...`
worse than case?

And where exactly was the question about API functions, I didn’t notice something right away?

Вадим   (2001-12-14 19:53) [9]

case? They arrived, rowed all night, and forgot to untie the boat ...

function IsRus (s: string): boolean;
was
i: integer;
const
RusChars = ["A" .. "I", "a" .. "I"];
begin
Result: = False;
for i: = 1 to Length (s) do
if s [i] in RusChars then
begin
Result: = True;
Break;
end;

Mick   (2001-12-14 19:55) [10]

Better this way :)
``` for i: = 1 to Length (s) do begin Result: = s [i] in RusChars; if Result then Break; end; ```

Mbo   (2001-12-15 07:53) [11]

> how to determine what is in the line only: latin letters and service signs
onlylat: = true;
for i: = 1 to length (s) do if ord (s [i])> 127 then begin
onlylat: = false;
break;
end;

Anatoly Podgoretsky   (2001-12-15 12:07) [12]

Better all the same not (s [i] in LatinAndSpecialChars) otherwise, some signs are cut off, for example, monetary symbols and some other
It will be more flexible

Dmitry1   (2001-12-17 15:08) [13]

Thanks to everyone who called.

Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;