Autor Beitrag
Roadrunner116
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Mi 24.01.07 17:23 
Hallo, ich mal wieder.....

ich möchte eine procedure erstellen, die mit StringReplace bestimmte Zeichen aus Memo_Input umwandelt und in Memo_Output ausgibt!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure verSchluessel(text: string);
begin
  text := StringReplace(text, '\''/', [rfReplaceAll, rfIgnoreCase]);
  Memo_Output.Text := text;
end;

procedure TForm_Main.Button1Click(Sender: TObject);
begin
  verSchluessel(Memo_Input.Text);
end;


bekomme aber eine Fehlermeldung!
ausblenden Quelltext
1:
2:
3:
[Fehler] code.pas(94): Undefinierter Bezeichner: 'Memo_Output'
[Fehler] code.pas(94): Operator oder Semikolon fehlt
[Fataler Fehler] codeerzeuger.dpr(5): Verwendete Unit 'code.pas' kann nicht compiliert werden


Danke schonmal...
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 24.01.07 17:26 
Moin!

Du mußt die Prozeduren als Mitglieder der Formularklasse deklarieren oder Form1.Memo... schreiben. ;)

Und das hier geht auch etwas "schonender": ;)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure verSchluessel(const Text: string);  
begin  
  Form1.Memo_Output.Text := StringReplace(Text, '\''/', [rfReplaceAll, rfIgnoreCase]);
end;

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Mi 24.01.07 17:28 
Hi Roadrunner,

du deklarierst die procedure oben im Public Abschnitt:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
public
    { Public-Deklarationen }
    procedure verSchluessel(text: string);

// und dann in der jetzigen Deklaration:

procedure TForm1.verSchluessel(text: string); // oder TForm2 oder wie auch immer
begin
  text := StringReplace(text, '\''/', [rfReplaceAll, rfIgnoreCase]);
  Memo_Output.Text := text;
end;


Gruß

Saubäär
Roadrunner116 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Mi 24.01.07 17:36 
Danke, funktioniert prima.....

Gruß Roadrunner116
Roadrunner116 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Mi 24.01.07 17:51 
sorry....
noch ein problem!

wenn ich jedem zeichen (Zahlen, Buchstaben, Sonderzeichen) eine Hexadezimalzahl, beginnend mit einer # zugewiesen habe, dann müsste ich eigentlich etwas, wie:

#4B#A4#32

herauskommen!

Leider wandelt er vorkommende zeichenja nochmal um (hatte mir das mit dne zahlem shcon gedahct und mich gedrückt, indem ich sie zu erst ersetzen lies, jedoch habe ich nicht daran geadcht, dass hexadezimal ja die buchstaben a-f enthält!!!).
Wie kann man das umgehen?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 24.01.07 20:15 
Moin!

Ähhh :gruebel: ich versteh kein Wort :? :nixweiss: ;)

Aber das scheint mit eh ein anderes Thema zu sein, also bitte neuer Problem-Erläuterungsversuch und neuer Thread! :mahn: (anderes Problem -> anderer Thread) ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Roadrunner116 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Do 25.01.07 22:39