![]() |
Quellcode klappt nicht
Wieso klappt dieser doch sehr einfache Quelltext nicht?
Delphi-Quellcode:
procedure intxtschreiben(pfad,text:string;einmalig:boolean);
var txt:textfile; begin assignfile(txt,pfad); if fileexists(pfad) then reset(txt) else rewrite(txt); writeln(txt,inttostr(lauf)); closefile(txt); end; Compilieren tut er das gut, aber beim ausführer maktiert er die Zeile mit writeln und meldet: --------------------------- Debugger Exception Notification --------------------------- Project Corioliskraft.exe raised exception class EInOutError with message 'I/O error 105'. Process stopped. Use Step or Run to continue. --------------------------- Hinweis lauf eristiert und die Variablen wurden alle ordnungsgemäß zugewiesen. |
Re: Quellcode klappt nicht
Hallo!
Muesste so funktionieren:
Delphi-Quellcode:
procedure intxtschreiben(pfad, Text: string);
var txt: TextFile; begin AssignFile(txt, pfad); if fileexists(pfad) then Append(txt) else Rewrite(txt); Writeln(txt, IntToStr(123)); Closefile(txt); end; |
Re: Quellcode klappt nicht
Wow. Es klappt.
Wo ist denn der Unterschied zwischen reset und append? |
Re: Quellcode klappt nicht
Zitat:
Zitat:
|
Re: Quellcode klappt nicht
Danke.
Klappt alles wunderbar. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:55 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz