.


:




:

































 

 

 

 


1

 

Delphi

 

. .

1. .

1. . Windows .

2. , .

3. : EXAMPL, 1, Convertor.

4. Delphi .

2. , Delphi.

, ASCII ANSI.

1. . : File->New->Other->Console Application.

2. , , EXAMPL, exampl1. File->Save All-> Z, EXAMPL. .

3. (Begin..end.) :

Writeln (¢ ANSI ( Windows 1251), ASCI I 866¢);

Readln // Enter

4. Project->Compile.

5. , ( exe) . EXAMPL.

6. Run->exampl1.exe ( F9).

7. . ?

3. Windows DOS RUS.

RUS, DOS(ASCII).

1. ( Begin) RUS, ANSI 1251 ASCII:

function RUS(s:string):string; //

var i:longint;

begin

for i:=1 to length(s) do

begin

if ord(s[i]) in [192..239] then s[i]:=chr(ord(s[i])-64);

if ord(s[i]) in [240..255] then s[i]:=chr(ord(s[i])-16);

end;

RUS:=s

end;

2. RUS . .

Writeln (RUS( ¢ 1251, ASCI I ¢ ));

3. .

4. Unit

. Unit .

1. unit RUS, :

File->New ->Unit

RUS ( ) ( implementation)

( interface).

unit unit1;

interface //

function RUS(s:string):string;

implementation //

function RUS(s:string):string;

var i:longint;

begin

for i:=1 to length(s) do

begin

if ord(s[i]) in [192..239] then s[i]:=chr(ord(s[i])-64);

if ord(s[i]) in [240..255] then s[i]:=chr(ord(s[i])-16);

end;

RUS:=s

end;

end.

convertor Convertor.

2. , . . .

3. . , .

4. , Save .

5. - Delphi.

, :

byte, integer, int64 real, extended, comp;

: ( ).



<== | ==>
1. | ,
:


: 2016-09-03; !; : 276 |


:

:

, .
==> ...

1906 - | 1718 -


© 2015-2024 lektsii.org - -

: 0.014 .