Autor Beitrag
N47R0N
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Mo 23.05.05 13:42 
Hi @ All

Ich habe nur aus langeweile vor eine art umwandler zu Programmieren der sone art geheimschrift übersetzt

z.B :

Das E wird umgewandelt = 3
Das M wird umgewandelt = /\/\
Das A Wird umgewandelt = 4

Ich will das wenn ich jetzt z.B eine zeile wie "EMA" in das Memo1 Feld schreibe und dann auf einen Button klicke der ganse Text den ich ins Memo1 Feld geschrieben habe übersetzt ins Memo2 Feld geschrieben wird also :

EMA = 3/\/\4


wie könnte ich das realisieren???


Danke
Asgar
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Mo 23.05.05 13:44 
du liest jeden buchstaben einzeln ein und machst dann ne case abfrage bei der du sagst in was du den Buchstaben umwandeln willst.
Asgar
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

XP Home Edition
D5
BeitragVerfasst: Mo 23.05.05 13:57 
hab dir mal ein Beispiel dazu geschrieben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.Button1Click(Sender: TObject);
var Buchstaben:string;
a:Integer;
begin

Buchstaben:=edit1.text;                      //Das Wort aus Editfeld1 wird in der variablen Buchstaben gespeichert

for a:=1 to length(Buchstaben)do             //Das Programm geht alle Buchstaben des Wortes durch
begin

  case Buchstaben[a] of                      //Die Buchstaben werden umgewandelt
  'a','A':Buchstaben[a]:='1';
  'b','B':Buchstaben[a]:='2';
  end;


end;

edit2.text:=Buchstaben;                       //Das umgewandelte Wort wird in editfeld2 geschrieben
end;
N47R0N Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 134



BeitragVerfasst: Mo 23.05.05 17:03 
THX