Das Alphabet soll in edit3 angezeigt werden.
Wissr ihr wie das geht?
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) Memo1: TMemo; Memo2: TMemo; Button1: TButton; Edit1: TEdit; Edit2: TEdit; Button2: TButton; Edit3: TEdit; procedure Button1Click(Sender: TObject); private public end;
var Form1: TForm1;
implementation
{$R *.dfm}
Type Talphabet=ARRAY['A'..'Z']of Char; var Alphabet : TAlphabet;
procedure BereinigeSchluesselwort(var Wort: String); var Wortkopie : String; I: Integer; begin Wortkopie:= Wort[1]; for I := 2 to length(Wort) do if pos(wort[i],Wortkopie)= 0 then wortkopie:= wortkopie + Wort[i]; Wort:= Wortkopie; end;
Procedure ErstelleCodeTabelle(SWort : String;Startbuchstabe : Char; var Alphabet : TAlphabet); var stelle : Char; i : integer; begin for stelle := 'A' to 'Z' do alphabet[stelle]:= ' '; stelle:= Startbuchstabe; for i:= 1 to length(SWort) do begin Alphabet[stelle]:= SWort[i]; stelle:= succ(stelle); end;
for stelle := 'A' to 'Z' do Form1.edit3.text:= Form1.edit3.text + alphabet[stelle]; end;
function kodiere(originalzeichen : char; Alphabet : TAlphabet) : Char; begin
end;
procedure TForm1.Button1Click(Sender: TObject); var SWort : String; Startbuchstabe : Char; zaehler, verschiebelaenge : integer; begin SWort:= uppercase(edit1.text); BereinigeSchluesselwort(SWort); Startbuchstabe:= Edit2.text[1]; ErstelleCodeTabelle(SWort,Startbuchstabe,Alphabet); memo1.Text:= uppercase(memo1.Text); for zaehler:= 1 to Length(memo1.text) do begin if memo1.Text[zaehler] in ['A'..'Z'] then memo2.Text:= memo2.Text + Kodiere(memo1.Text[zaehler],Alphabet); end; end;
end. |
soweit bin ich bis jetzt. Also in edit1 wird das Schlüsselwort eingetragen, in edit 2 wird der anfangsbuchstabe eingetragen (der Ort wo das Schlüsselwort beginnen soll). In edit3 soll das verschlüsselte Alphabet stehen(tut es aber nicht) Was muss ich machen, dass das Alphabet dort angezeigt wird.