Ładny brzuch

Dlaczego ten program wyswietla mi 3 bledy ??

unit Unit1; interface uses  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  Dialogs, StdCtrls, ToolWin, ComCtrls; type  TForm1 = class(TForm)    Label1: TLabel;    Edit1: TEdit;    StatusBar1: TStatusBar;    CoolBar1: TCoolBar;    Button1: TButton;    Label2: TLabel;    Label3: TLabel;    Edit2: TEdit;    Edit3: TEdit;    Label4: TLabel;    Label5: TLabel;    procedure Button1Click(Sender: TObject);  private    { Private declarations }  public    { Public declarations }  end; var  Form1: TForm1; implementation uses Unit2; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin var Kasia : String; begin if Form1.Edit3.text = 'Kasia' then begin Form2.Show; Form1.Edit2.text := Form2.Label1.Caption; Form1.Edit3.Text := Form2.Label2.Caption; end else showmessage ('Haslo zle ! Sproboj ponownie'); Form1.Show; end; end.

Bledy :

[Error] Unit1.pas(41); Statement expected but 'VAR' found
[Error]Unit1.pas(65) '.' expected but ';' found
[fatal error] project1.dpr(6) couldnt compile used unit 'Unit1.pas'
Uytkownik B-L-I-z-Z-A-R-D edytowa ten post 01 czerwiec 2006, 09:48


Lol procedure TForm1.Button1Click(Sender: TObject);
begin <- usu

Ty sie dopiero uczysz delphi? Albo masz nawyki z c++. W pascalu nie da sie zadeklarowac zmiennych w bloku begin..end /{..} w c++/. Zmienne deklarujesz po slowie kluczowym var ktore to musi wystepowac zaraz po deklaracji procedury/funkcji i nie moze byc niczym poprzedzone /ew. deklaracja stalej albo jakiejs zagniezdzonej funkcji/procedury/.
To nie c++ ze tworzysz kiedy chcesz nowe zmienne.

:lol:

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • zsf.htw.pl
  •