All pastes #215212 Raw Edit

Untitled

public text v1 · immutable
#215212 ·published 2006-10-22 13:40 UTC
rendered paste body
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Bloeschen: TButton;
    Label1: TLabel;
    StringGrid1: TStringGrid;
    Bfuellen: TButton;
    Benden: TButton;
    procedure BloeschenClick(Sender: TObject);
    procedure BendenClick(Sender: TObject);
    procedure BfuellenClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.BloeschenClick(Sender: TObject);
var count : integer;
    eingabe, ausgabe, zwischen : string;
begin
  eingabe := uppercase(edit1.Text);
  ausgabe := '';
    for count := 1 to length(eingabe) do begin
      zwischen := copy(eingabe, count + 1, length(eingabe) - count);
        if pos(eingabe[count], zwischen) = 0 then
        ausgabe := ausgabe + eingabe[count];
    end;
  label1.caption := ausgabe;


end;


procedure TForm1.BfuellenClick(Sender: TObject);
var   k,l : integer;
      schluesselw : string;

begin
    for k :=0 to 25 do begin
    stringgrid1.Cells[0, k] := chr(k + 65);
    end;
    schluesselw := label1.Caption;
    
    for k:= 1 to length(label1.Caption) do
    stringgrid1.Cells[1,k-1] := label1.Caption[k];

    l:=0;
    for k:= 65 to 90 do
      if pos(chr(k), label1.caption) = 0
      then begin
        stringgrid1.cells[1,l+length(label1.caption)]:=chr(k);
        l:=l+1;
      end;
end;

procedure TForm1.BendenClick(Sender: TObject);
begin
close;
end;


end.