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

WinXP
Delphi 6 Personal
BeitragVerfasst: Do 09.11.06 10:36 
Wie kann ich eine Zahl die in einer Textdatei steht zur Verwendung in eine Variable laden??
Horschdware
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Do 09.11.06 10:47 
Was steht denn alles in der date drin? nur die zahl, oder noch etwas anderes unverwertbares?

_________________
Delphi: XE - OS: Windows 7 Professional x64
tommythe1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

WinXP
Delphi 6 Personal
BeitragVerfasst: Do 09.11.06 10:49 
nur die zu verwendende Zahl, nichts anderes
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Do 09.11.06 11:47 
so z.B. :
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
var 
        dateiname            :string;
        datei                :TextFile;
        puffer               :AnsiString;
        DateiInhalt          :AnsiString; 
        meineZahl            :Integer; 
begin 
DateiInhalt := '';
dateiname := 'C:/bla/blub/tollertext.txt';

AssignFile(datei, dateiname); 
Reset(datei); 
repeat
   Readln(datei, Puffer);
   DateiInhalt := DateiInhalt + Puffer;
until EOF(datei);
CloseFile(datei); 
meineZahl := strtoint(DateiInhalt);
tommythe1 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

WinXP
Delphi 6 Personal
BeitragVerfasst: Do 09.11.06 12:10 
danke das hat prima geklappt

PS: hätte ich eigentlich selber drauf kommen können :?