Autor Beitrag
steve-allround
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Linux, Windows

BeitragVerfasst: Mo 10.10.05 19:34 
Hallo,

Ich habe eine Datei und eine ShowMessage. Nun soll wenn in einer Datei z.B. test.txt ein 'on' steht die ShowMessage ausgeführt werden.

Ich habe folgende Message:

ausblenden Delphi-Quelltext
1:
ShowMessage('Weitere Infos erhalten Sie in der Hilfe');					



Vielen Dank

Moderiert von user profile iconKlabautermann: Delphi-Tags hinzugefügt.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 10.10.05 23:03 
Moin!

Such mal hier nach INI-Dateien und beschäftige dich damit; das ist vermutlich das, was du brauchst.

cu
Narses
steve-allround Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Linux, Windows

BeitragVerfasst: Do 13.10.05 18:00 
Hy,

also ich habe jetzt lange nachgeschaut und finde kein Ergebnis. Ich bin noch ein totaler Anfänger und bräuchte aber die Lösung um bei einem Beispiel fertig zu werden.

Kann mir jemand den Quelltext geben?
MisterBum83
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 245
Erhaltene Danke: 2

WIN XP
Delphi 6
BeitragVerfasst: Do 13.10.05 18:03 
user profile iconsteve-allround hat folgendes geschrieben:


Kann mir jemand den Quelltext geben?


Sollen wir dir ein Programm schreiben oder was? Da bist du hier leider falsch!!!

Außerdem weiß keiner genau, was du überhaupt willst...
steve-allround Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Linux, Windows

BeitragVerfasst: Do 13.10.05 18:15 
Nein,
ein Programm soll mir keiner schreiben.
Außerdem bin ich neu und komme bei diesen Quelltext einfach nicht weiter.

Ich erkläre es nochmal:

Ich habe eine Datei: xy.txt. Dort steht ein Wort 'on'. Nun soll z.B. bei einem klick auf ein Button ein Message: ShowMessage('Weitere Infos erhalten Sie in der Hilfe');
angezeigt werden, aber nur wenn das Wort 'on' in der Datei steht. Ansonsten erscheint keine Message.

Ich hoffe, ich habe das rellativ gut erklärt.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 13.10.05 18:21 
Ist bestimmt nicht böse gemeint, aber wie MisterBum83 schon sagt kommt dein Problem nicht richtig rüber und wie Narses schon sagt Ini.
Ich hab mir mal deine anderen Post's angesehen und es zielt alles auf Ini hinaus. !?
Jetzt die Frage (Es ist relativ schwierig das on aus einer Textdatei zu lesen, aber kein Problem das on - als String aus einer Ini).
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: Do 13.10.05 18:25 
Probiers mal grob so:
ausblenden Delphi-Quelltext
1:
2:
memo1.lines.loadfromfile('meineDatei.txt');
if pos(memo1.text,'on') > 0 then showmessage('On Gefunden');


Die Syntaxfehler bitte selber berichtigen ;-)

_________________
We are, we were and will not be.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 13.10.05 18:47 
Am besten Du schilderst mal was Du vorhast.
Als Anhaltspunkt das was Gausi sagte.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
Procedure TForm1.Button1Click(Sender: TObject);
var
 i:Integer;
begin
  for i:=0 to Memo1.Lines.Count-1 do
   if pos('on',Memo1.Lines[i])>0 then ShowMessage('On -  Gefunden');
end;
steve-allround Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 59

Linux, Windows

BeitragVerfasst: Do 13.10.05 19:02 
Wow,

echt vielen Dank.

Genau das war es.... Ihr habt mir sehr geholfen.

Danke