Autor Beitrag
Jana
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP, Win Vista
Delphi 2005, Visual Basic .Net
BeitragVerfasst: Di 15.08.06 12:58 
Hallo,

ich bin momentan dabei eine kleine Prozedur zu schreiben und will dabei, dass Delphi mir bestimmte Zeichen in eine Zahl umwandelt.

Beispiel:

ausblenden Quelltext
1:
2:
3:
4:
function SymToBy(Sym: String): Byte;
begin
   if Sym = 'a' then result := 01;
end;


Wenn ich aber nun das Hochkomma als String eingeben will, denkt das Programm immer, dass ich den String beenden will.

ausblenden Quelltext
1:
if Sym = ''' then result := 02;					


Wie kann ich das verhindern?
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Di 15.08.06 13:02 
du musst das hochkomma doppeln, also so

ausblenden Delphi-Quelltext
1:
if Sym = '''' then result := 02;					


viele grüße
alex
Jana Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP, Win Vista
Delphi 2005, Visual Basic .Net
BeitragVerfasst: Di 15.08.06 13:44 
Danke für deine Hilfe Alex. :D
Das Programm funktioniert jetzt.