Ich hab nen Quelltext, kann ihn aber nicht ausführen, da ich immer so ne 'Access Violation'Message bekomm. Kann aber den Grund dafür nich finden.
P.s.: die Datei im Quelltext gibts und sie hat 3 Zeilen.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls;
type TForm1 = class(TForm) RichEdit1: TRichEdit; procedure FormCreate(Sender: TObject); private public end;
var Form1: TForm1; Actual: TStringList; Last: TStringList;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject); begin Last:= TStringList.create; Actual:= TStringList.create; Actual.LoadFromFile(ExtractFilePath (ParamStr(0)) + 'HS BTD X1.reddata'); Actual[0]:= timetostr(Now); Actual[1]:= 'empty'; Last.LoadFromFile(ExtractFilePath (ParamStr(0)) + 'HS BTD X1.reddata'); RichEdit1.MaxLength:= 255; RichEdit1.Lines[0]:= Last[0]; RichEdit1.Lines[1]:= Last[1]; Last.Free; Actual.SaveToFile(ExtractFilePath (ParamStr(0)) + 'HS BTD X1.reddata'); Last.Free; end;
end. |
Moderiert von
tommie-lie: Code- durch Delphi-Tags ersetzt