All pastes #237573 Raw Edit

Stuff

public text v1 · immutable
·published 2006-11-04 17:01 UTC
rendered paste body
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var a,b,um:integer; text:string;
begin
um:=strtoint(Edit1.text);
text:=memo1.text;
text:=uppercase(text);

for a:=1 to length(text)
do begin
b:=ord(text[a]);
if (b>=65) and (b<=90)
then begin
b:=b+um;
if b>90
then b:=b-26;
end;
text[a]:=chr(b);
end;
memo1.Text:=text;
end;
end.