Autor Beitrag
drsnoop
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37

Win XP
D7 Enterprise
BeitragVerfasst: Mi 10.03.04 17:05 
habe ein problem mit folgendem programm... nämlich:

ich wollte einen text zeichen für zeichen codieren. was auch ohne probleme klappt...
jedoch wollte ich dem programm nun sagen, dass es einen absatz bzw. eine leerzeile
sozusagen ignorieren soll und einfach zum nächsten zeichen springen soll.

was ich meine ist das:

wenn ich folgendes eingebe:

"xxxxxx
xxx
xxxxxx"

macht es daraus:

"yyyyyyyyyyyyyyy"

es soll aber

"yyyyyy
yyy
yyyyyy"

ausgeben...

ich habe es mal so probiert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.Button1Click(Sender: TObject);
 var i, j : integer;
     ausgabe1 : string;
begin
 for i := 1 to length(m_eingabe.text) do
 begin
  if (ord(m_eingabe.text[i]) = 13)
     then ausgabe1 := ausgabe1 + m_eingabe.text[i] 
     else ausgabe1 := ausgabe1 + chr(ord(m_eingabe.text[i])+ord(tf_key.text[j])); //codierung
 end;


geht aber irgendwie nicht... kann mir da jemand helfen?

_________________
(¯`·.¸¸.·´(¯`·.¸ Es gibt keine dummen Fragen... Nur dumme Menschen ¸.·´¯)`·.¸¸.·´¯)
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Mi 10.03.04 17:13 
Hi,

kleiner tip: ein zeilenunbruch besteht aus #13#10 :wink:

mfg.

_________________
mfg.
mâximôv
drsnoop Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37

Win XP
D7 Enterprise
BeitragVerfasst: Mi 10.03.04 17:37 
hoppla... wusste ich nicht....

aber wie krieg ich dat in den quelltext?

_________________
(¯`·.¸¸.·´(¯`·.¸ Es gibt keine dummen Fragen... Nur dumme Menschen ¸.·´¯)`·.¸¸.·´¯)
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Do 11.03.04 11:15 
moin.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
if ((m_eingabe.text[i] = #13and (m_eingabe.text[i+1] = #10)) 
or ((m_eingabe.text[i] = #10and (m_eingabe.text[i-1] = #13))
     then ausgabe1 := ausgabe1 + m_eingabe.text[i]  
     else ausgabe1 := ausgabe1 + chr(ord(m_eingabe.text[i])+ord(tf_key.text[j])); //codierung


oder so :wink:

_________________
mfg.
mâximôv