Autor Beitrag
Die Brotmafia
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

Win XP Suse Linux 9.3
Delphi 7 Enterprise, Delphi 2005
BeitragVerfasst: Fr 23.12.05 20:09 
So, ich hab ein kleines Problemchen:

Ich hab nen kleinen Code für euch:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
    if text='Download2'
   then begin
   showmessage('downloading') 
    end;

    if text='Download2' + irgendeinstringegalwasfüreiner
     then
     close;


Genau sowas will ich machen, also wenn der Text jetzt Download2 ist und dann noch irgend ein Text dabei ist, egal was, irgend ein String halt, dann soll er close machen, aber ich komm einfach nicht so recht drauf wie ich das umsetzen kann?
Ich hätte gerne dass sobald irgendwas zusätzliches hinter dem Download2 steht, dass dann gecloset wird...

Schon mal im Vorraus danke für eure Hilfe!!

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt
Moderiert von user profile iconUGrohne: Topic aus Sonstiges verschoben am Fr 23.12.2005 um 21:03
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Fr 23.12.05 20:14 
ausblenden Delphi-Quelltext
1:
if copy(text, 0, 9) = 'Download2' then close;					

Du kopierst einfach die ersten 9 Zeichen aus dem String "Text" heraus, wobei du bei Index 0, also dem 1. Buchstaben beginnst.

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN


Zuletzt bearbeitet von alias5000 am Fr 23.12.05 20:26, insgesamt 1-mal bearbeitet
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Fr 23.12.05 20:18 
Öhm
ausblenden Delphi-Quelltext
1:
If Text <> 'Download2' Then close;					


so oder wie meinst das?
Die Brotmafia Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

Win XP Suse Linux 9.3
Delphi 7 Enterprise, Delphi 2005
BeitragVerfasst: Fr 23.12.05 20:58 
Ne, so meinte ich das eigentlich nicht.

Ich hätte es gerne so gehabt, dass z.B.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
 

if text='Download2' + irgendwas
 then begin
 memo1.lines.add(irgendwas);
 close;
end;


Ich würde gerne das "Irgendwas" wo ich nicht weis wie ichs nennen soll weiter verwenden...

Moderiert von user profile iconUGrohne: Code- durch Delphi-Tags ersetzt
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Fr 23.12.05 21:06 
ja sag doch auch :)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
If ('Download2' = copy(text,0,9)) And (Length(text) > 9) Then
begin
  Memo1.Lines.Add(copy(text,10,Lenght(text));
  close;
end;


so ungefähr habs nit getestet müsst aber gehn
Die Brotmafia Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

Win XP Suse Linux 9.3
Delphi 7 Enterprise, Delphi 2005
BeitragVerfasst: Fr 23.12.05 21:19 
Danke, das ist perfekt und funktioniert super!!

Kann mir noch einer genau erklären wie das funktioniert?

ausblenden Delphi-Quelltext
1:
If ('Download2' = copy(text,0,9)) And (Length(text) > 9) Then					


Also wenn Download2 = Copy(text,0,9) ist?? was bedeutet das? das mit der length und so blick ich ja jetzt...

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Fr 23.12.05 21:22 
Das mach ich geli auch noch
copy nimmt aus dem string hier text von dem nulltem buchsatben (der erste ;D ) an die nächsten 9
und length gibt einfach nur die länge eines strings wieder
kp ob das verständlich is aber in der hilfe stehts vllt noch weng besser
Die Brotmafia Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

Win XP Suse Linux 9.3
Delphi 7 Enterprise, Delphi 2005
BeitragVerfasst: Fr 23.12.05 21:57 
:D, ich sollte wohl lernen die Hilfe zu benutzen, kann mir mal kurz einer ne Schritt für Schritt Anleitung geben wie ich in die Hilfe komme und da das Thema finde?

Danke!!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 23.12.05 22:28 
user profile iconDie Brotmafia hat folgendes geschrieben:
:D, ich sollte wohl lernen die Hilfe zu benutzen, kann mir mal kurz einer ne Schritt für Schritt Anleitung geben wie ich in die Hilfe komme und da das Thema finde?

1. Delphi starten.
2. F1 Drücken
3. Auf "Hilfethemen" klicken
4. gewünschten Begriff eintippen/auswählen

Halt so, wie man es sonst in Windows auch macht...:gruebel:

_________________
We are, we were and will not be.
Amateur
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 777

(Win98, WinMe) WinXP Prof
D3 Prof, D6 Pers, D2k5 Pers., Turbo C++ Explorer
BeitragVerfasst: Fr 23.12.05 22:32 
ich kann auch diese links empfehlen:
Crashkurs Delphi
und
Delphi Source
und
Delphi Basics für diverse Befehle

_________________
"Kein dummes Gerede. Kein Rumrätseln. Denkt an nichts anderes mehr, nur noch an das, was vor euch liegt. Das ist die wahre Herausforderung. Ihr müßt euch vor euch selbst schützen, Leute." (Rennes in "Cube")
Beiträge: >700
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Sa 24.12.05 10:35 
Ganz am Rand:

user profile iconalias5000 hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
if copy(text, 0, 9) = 'Download2' then close;					

Du kopierst einfach die ersten 9 Zeichen aus dem String "Text" heraus, wobei du bei Index 0, also dem 1. Buchstaben beginnst.

Gruß alias5000


einige Posts später:

user profile iconIronwulf hat folgendes geschrieben:
ja sag doch auch :)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
If ('Download2' = copy(text,0,9)) And (Length(text) > 9) Then
begin
  Memo1.Lines.Add(copy(text,10,Lenght(text));
  close;
end;


so ungefähr habs nit getestet müsst aber gehn


der nächste:

user profile iconDie Brotmafia hat folgendes geschrieben:
Danke, das ist perfekt und funktioniert super!!

Kann mir noch einer genau erklären wie das funktioniert?

ausblenden Delphi-Quelltext
1:
If ('Download2' = copy(text,0,9)) And (Length(text) > 9) Then					


Also wenn Download2 = Copy(text,0,9) ist?? was bedeutet das? das mit der length und so blick ich ja jetzt...

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt


naja egal bis auf die sache mit length > 9 war die Frage schon ab der ersten Antwort geregelt :wink:

Euch allen n frohes Fest!
Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN