PHP код:
unit project1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Label2: TLabel;
Button2: TButton;
GroupBox1: TGroupBox;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
Const
M: Array[1..58] of String = ('ox','uh','rr','un','yk','he','po','mq','me','je','eq','hh','pl','kj','nb','mm','cz','zz','xx','io','rg','nj','qs','tc','qw','nc','ba','wv','op','lm','dd','ad','1m','0w','3u','6v','7d','9i','d1','z3','q4','6c','7f','9g','8b','k3','9c','3a','5q','8d','j1','z1','#6','2p','3l','6o','8y','c1');
Z: Array[1..58] of String = ('а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'щ', 'ш', 'ь', 'ы', 'ъ', 'э', 'ю', 'я', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
Var
S: String;
n, i: Integer;
begin
n:= 1; Label1.Caption:= '';
While n < Length(Edit1.Text) Do
begin
S:= Copy(Edit1.Text, n, 2);
For i:= 1 To 58 Do if S = M[i] Then Label1.Caption:= Label1.Caption + Z[i];
Inc(n, 2);
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
Const
M: Array[1..58] of String = ('ox','uh','rr','un','yk','he','po','mq','me','je','eq','hh','pl','kj','nb','mm','cz','zz','xx','io','rg','nj','qs','tc','qw','nc','ba','wv','op','lm','dd','ad','1m','0w','3u','6v','7d','9i','d1','z3','q4','6c','7f','9g','8b','k3','9c','3a','5q','8d','j1','z1','#6','2p','3l','6o','8y','c1');
Z: Array[1..58] of String = ('а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'щ', 'ш', 'ь', 'ы', 'ъ', 'э', 'ю', 'я', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
Var
S: String;
n, i: Integer;
begin
n:= 1; Label1.Caption:= '';
While n <= Length(Edit1.Text) Do
begin
S:= Copy(Edit1.Text, n, 1);
For i:= 1 To 58 Do if S = Z[i] Then Label1.Caption:= Label1.Caption + M[i];
Inc(n, 1);
end;
end;
end.
и ещё, как в сделать так, что бы результат выводил не в Label, а в Memo. Memo1.Name и просто Memo не работает(((
|