Autor Beitrag
mangaka
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42

windows xp sp2
Delphi 2005 personal
BeitragVerfasst: Do 20.07.06 21:34 
Hi Leute,
Ich hoffe, dass ich den richtigen Bereich für meine Frage gewählt habe, wenn nicht bitte ich das zu entschuldigen :)

Aber jetzt zu meiner Frage. Unzwar möchte ich aus einer Textdatei Informationen auslesen. Jede Zeile soll dabei eine Information beinhalten, die das Programm nach dem Auslesen bearbeitet.

Beispiel Info.txt:
Username=mangaka
Age=17
City=Oldenburg

Wie ich eine Zeile bearbeite, habe ich mir schon im Groben überlegt, unzwär würde ich die Zeile Splitten und als Trenner '=' verwenden(oder so ähnlich).
Nur was ich nicht weis ist, dass ich keine Ahnung habe wie ich jede einzelne Zeile auslese. Vllt liegt das auf der Hand, aber immo sehe ich keine Lösung ^^

Danke im Vorraus :)
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 20.07.06 21:45 
Moin!

Probier das mal so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm1.Button1Click(Sender: TObject);
  var
    Zeilen: TStringList;
    i: Integer;
begin
  Zeilen := TStringList.Create; // Objekt erzeugen
  try
    try
      Zeilen.LoadFromFile('Dateiname.txt'); // Datei lesen
    except // wenn ein Fehler auftritt
      ShowMessage('Fehler beim Laden der Datei!');
    end;
    for i := 0 to Zeilen.Count-1 do // über alle Zeilen der Datei
      ShowMessage(Zeilen.Strings[i]); // einzeln Anzeigen
  finally // auf jedenfall am Ende
    Zeilen.Free; // das Objekt wieder freigeben
  end;
end;

cu
Narses

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

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 20.07.06 21:46 
Schau mal nach Ini, die sind genau in dem Prinzip aufgebaut.
mangaka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42

windows xp sp2
Delphi 2005 personal
BeitragVerfasst: Do 20.07.06 22:15 
und unter welchem Begriff soll ich nachschauen? alleine nur .ini hilft mir nicht weiter^^

@Narses
Vielen Danke, werde ich so schnell wie Möglich ausprobieren.
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Do 20.07.06 22:29 
Hi, Suche in der Entwickler-Ecke TINIFILE

EDIT: Hab hier noch was für dich gefunden: dsdt.info/tutorials/ini/

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
mangaka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42

windows xp sp2
Delphi 2005 personal
BeitragVerfasst: Do 20.07.06 22:42 
Dankeschön,
Guten Abend, euch Allen ^^
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 20.07.06 22:47 
Der ist besser und auch einfacher zu verstehen.
www.kuknet.de/tutorial1.pdf
oldmax
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 380


D3 Prof, D4 Prof
BeitragVerfasst: Fr 21.07.06 09:06 
Hi Mangake

Ich habe grade ein kleines Tutorial in die Rubrik Datenbank gesetzt, als Antwort auf eine Bitte um "Erleuchtung". Vielleicht hilft's dir bei deinem kleinen Problemchen...

Gruß oldmax

_________________
Zier dich nich so, ich krieg dich schon....
mangaka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42

windows xp sp2
Delphi 2005 personal
BeitragVerfasst: Fr 21.07.06 11:12 
Titel: danke
vielen dank erstmal für die vielen antworten.
mein problem hat sich spätestens mit dem link von Blackheart666 gelöst.
ich werde mir dein tutorial dennoch ansehen, hehe ^^

cya