Registriert seit: 23. Jun 2011
25 Beiträge
|
AW: per buttonklick neues fenster öffnen
27. Jun 2011, 12:21
Unit1 Quelltext:
Delphi-Quellcode:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
var
Form2: TForm2;
begin
Form2 := TForm2.Create(Self);
try
Form2.ShowModal;
finally
Form2.Free;
end;
end.
Unit2 Quelltext:
Delphi-Quellcode:
unit Unit2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs;
type
TForm2 = class(TForm)
private
{ private declarations }
public
{ public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.lfm}
end.
Bei Unit 1 tritt der Fehlerauf: unit1.pas(35,5) Fatal: Syntax error, ";" expected but "identifier FORM2" found
Delphi-Quellcode:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
<Form2>.Show;
end;
end.
Dort trittt dieser Feehler auf: unit1.pas(34,4) Fatal: Syntax error, ";" expected but "identifier FORM2" found
Geändert von mkinzler (27. Jun 2011 um 12:24 Uhr)
Grund: Delphi-Tags eingefügt
|
|
Zitat
|