Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls;
- type
- TForm1 = class(TForm)
- Memo1: TMemo;
- Memo2: TMemo;
- Button1: TButton;
- Button2: TButton;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- function cEcezar(s:string;key:byte):string;
- var i:integer; c,d:char;
- begin
- for i:=1 to length(s) do
- begin
- c:=s[i];
- if not (c in [#10, #13]) then
- d:=chr((ord(c)+ key)mod 255)
- else d := c;
- Result:=Result+d;
- end;
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- Memo2.Text := cEcezar(Memo1.Text, 3);
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- Close;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement