Autor Beitrag
G-McKree
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Fr 06.06.03 19:09 
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.

ausblenden volle Höhe Delphi-Quelltext
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
    { Private declarations }
  public
    { Public declarations }
  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 user profile icontommie-lie: Code- durch Delphi-Tags ersetzt
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: Sa 07.06.03 01:00 
hast du es mal schrittweise debuggt?

Gruß
Ken
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 07.06.03 07:24 
Das letzte last.free muß Actual.free heißen. Und dann würden deinem Code noch Ressourcen-Schutzblöcke mit try-finally gut tun.
G-McKree Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178



BeitragVerfasst: Sa 07.06.03 08:15 
Luckie hat folgendes geschrieben:
Das letzte last.free muß Actual.free heißen. Und dann würden deinem Code noch Ressourcen-Schutzblöcke mit try-finally gut tun.


*rofl* so was kann auch nur mir passieren

vieleicht sollte ich jede zeile schreibe, als immer die hälfte rumkopieren