Gast
#250404
Hallo!
Ich habe in Borland Delphi 6 vor ein Programm zu schreiben. Aber
bereits am Anfang kann er nicht compilieren...:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var zahl:Integer;
zahl:=0;
procedure TForm1.Button2Click(Sender: TObject);
begin
zahl:=1;
end;
end.
Die Fehlermeldung:
[Error] Unit1.pas(30): Identifier redeclared: 'zahl'
[Error] Unit1.pas(34): Constant expression violates subrange bounds
[Error] Unit1.pas(14): Unsatisfied forward or external declaration:
'TForm1.Button1Click'
[Fatal Error] Project3.dpr(5): Could not compile used unit
'Unit1.pas'
Was ist daran falsch? Kann man Befehle nicht außerhalb von Prozeduren
schreiben?
Mfg Xenon