Autor Beitrag
5M17H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 23.09.06 00:06 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
if FileExists('C:\code.txt')then
begin
  SetLength(zeile, 250);
  i := 0;
  dir := 'C:\code.txt'; //dateipfad
  AssignFile (f, dir); //datei öffnen, dir = dateipfad
  Reset (f); //'f' zurücksetzen
  while not EOF(f)do //weil das dokument ncoh nciht zu ende ist tue
  begin
    inc(i); //increas (i := i + 1;)
    ReadLn(f, zeile[i]); //zeile auslesen und in 'zeile' speichern
  end;


Tja befor das 'if FileExists' dastand ging alles, jetzt mäckert er bei 'Reset (f)' Warum=?

[edit]
beim menuepunkt 'speichern'
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Sa 23.09.06 00:11 
Was genau meckert er denn?

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 23.09.06 00:14 
Immer wenn ich was öffne bricht er das prog ab und:
"mit der Meldung 'E/A-Fehler 32' aufgetreten" Fortsetzen Anhalten Hilfe <Buttons.

Was los da?
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Sa 23.09.06 00:15 
Ja das kenn ich. E/A Fehler. Google hilft. Hab ich vorher auch nicht gewusst, ich guck gleich mal nach meinem eigenen Topic. Ich editiere das hier dann, wenn ichs hab...
edit: hier: help.netop.com/suppo...in32_error_codes.htm lass mal sehn.. 32...
Zitat:
The process cannot access the file because it is being used by another process. ERROR_SHARING_VIOLATION

Aha! Hast du die Code.txt vielleicht schon mit notepad offen? oder mit sonst einem Programm?

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 23.09.06 00:19 
Nein,
habe nur 'Lokaler Datenträger (C:\)' offen.
Da ist ja 'code.txt' -noch- gespeichert.

[edit]

weiter unten kommt aber
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
end
else
begin
  AssignFile(f,'C:\code.txt');
  Rewrite(f);
  for i := 0 to 59 do
  begin
    a := Random(9999);
    memo1.Lines.add(inttostr(a));
    //Writeln(f,memo1.lines);
  end;
end;
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Sa 23.09.06 00:28 
Naja, IRGENTETWAS scheint auf eine Datei, die du resetten willst ( kann wohl nur code.txt sein ;> ) zu zu greifen. versuch einen Neustart des PCs... Aber ob das klappt kann ich nicht garantieren :(

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 23.09.06 00:31 
gut danke
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 23.09.06 15:26 
user profile icon5M17H hat folgendes geschrieben:

weiter unten kommt aber
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
end
else
begin
  AssignFile(f,'C:\code.txt');
  Rewrite(f);
  for i := 0 to 59 do
  begin
    a := Random(9999);
    memo1.Lines.add(inttostr(a));
    //Writeln(f,memo1.lines);
  end;
end;

Und wo wird die Datei hier geschlossen?
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Sa 23.09.06 19:16 
Aaah haha.. das is natürlich n problem...
Ist das denn so, wenn die Datei nicht geschlossen ist, bleibt sie geöffnet nachdem dein Programm beendet wurde? Oder wird die dann geschlossen?

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.