Einzelnen Beitrag anzeigen

GouJetir

Registriert seit: 9. Sep 2011
30 Beiträge
 
#21

AW: Startzähler für Programm erstellen (Wichtig)

  Alt 10. Sep 2011, 21:52
Okay sorry Luckie

Also das wird mir geschrieben dann:

[Error]Unit1.pas[52];Undeclared identifier: 'StringVariable'
[Fatal Error]Project2.dpr(5):Could no compile used unit 'Unit1.pas'

Das ist der ganze Code:

Code:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
    List: TStrings;


implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  List := TStringList.Create;
  try
    List.LoadFromFile('C:\Daten.txt');
    if List.Count>0 then
      Edit1.Text:=List[0];
  finally
    List.Free;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  List := TStringList.Create;
  try
    List.Add(Edit1.Text);
    List.SaveToFile('C:\Daten.txt');
  finally
    List.Free;
end;
begin
StringVariable := IntToStr(StrToIntDef(StringVariable, 0) + 1);
end;
end;
end.
  Mit Zitat antworten Zitat