Lazarus lazarus / 12-Debugger ---------------------------------------------------------------------- Artem · 2016-11-12 14:22 How can I fix my code? The lazarus says:  Compile Project, Target: test.exe: Exit code 1, Errors: 1 Fatal: Syntax error, "BEGIN" expected but "end of file" found what should i do? I attached file also) unit Unit1; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,   StdCtrls; type   { TForm1 }   TForm1 = class(TForm)     Button1: TButton;     Button2: TButton;     Button3: TButton;     Button4: TButton;     Button5: TButton;     Button6: TButton;     Button7: TButton;     Button8: TButton;     Button9: TButton;     CheckGroup1: TCheckGroup;     CheckGroup2: TCheckGroup;     CheckGroup3: TCheckGroup;     CheckGroup4: TCheckGroup;     Label10: TLabel;     Label12: TLabel;     Label14: TLabel;     Label2: TLabel;     Label4: TLabel;     Label6: TLabel;     Label8: TLabel;     Memo1: TMemo;     RadioGroup1: TRadioGroup;     RadioGroup2: TRadioGroup;     RadioGroup3: TRadioGroup;     procedure Button1Click(Sender: TObject);     procedure result(k:integer);     procedure Button2Click(Sender: TObject);     procedure Button3Click(Sender: TObject);     procedure Button4Click(Sender: TObject);     procedure Button5Click(Sender: TObject);     procedure Button6Click(Sender: TObject);     procedure Button7Click(Sender: TObject);     procedure Button8Click(Sender: TObject);     procedure Button9Click(Sender: TObject);   private     { private declarations }   public     { public declarations }   end;   var   Form1: TForm1;   k,j:integer; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject); var Filename:string; begin Filename:=Application.ExeName; Close; WinExec(PChar(FileName),SW_SHOW); end; procedure TForm1.Button2Click(Sender: TObject); begin   Close; end; procedure TForm1.Button3Click(Sender: TObject); begin   Button3.Enabled:= False;   if (CheckGroup1.Checked[3])or (checkGroup1.checked[1])   and not (CheckGroup1.Checked[0])   and not   (CheckGroup1.Checked[2])   and not (CheckGroup1.Checked [4])   then begin     label2.visible:=true;   label2.caption:='Подумай ещё.' + #10#13 +'Ты на верном пути';   end     else   If (CheckGroup1.Checked[0]) or   Not(CheckGroup1.Checked[1]) or   (CheckGroup1.Checked[2])or   not (CheckGroup1.Checked[3])or   (CheckGroup1.Checked[4])   then   begin   Label2.vISIBLE:=True;   Label2.Caption:='Неправильно!';             end      else      if (CheckGroup1.Checked[3])and(CheckGroup1.Checked[1])      then      begin      Label2.Visible:=True;      Label2.CAPtion:='Верно!';      k:=k+1;      j:=j+1;      if j=7 then memo1.visible:=true; end; end; procedure TForm1.Button4Click(Sender: TObject); begin   Button4.Enabled:=False;   If RadioGroup1.ItemIndex=0   then Begin     Label4.Visible:=True ;     Label4.Caption:='Правильно';      k:=k+1;      j:=j+1;      if j=7 then memo1.visible:=true;     end   else   Begin     Label4.Visible:=True ;     Label4.Caption:='Неправильно';     end;   end; procedure TForm1.Button5Click(Sender: TObject); begin    Button5.Enabled:=False;   If RadioGroup3.ItemIndex=1   then Begin     Label6.Visible:=True ;     Label6.Caption:='Правильно';      k:=k+1;      j:=j+1;      if j=7 then memo1.visible:=true;     end   else   Begin     Label6.Visible:=True ;     Label6.Caption:='Неправльно';     end; end; procedure TForm1.Button6Click(Sender: TObject);   begin   Button6.Enabled:=False;   If (CheckGroup2.Checked[0])or   (CheckGroup2.Checked[1])   and not (CheckGroup2.Checked[2])   and not (CheckGroup2.Checked[3])         then   begin     Label8.Visible:=True;     Label8.Caption:= 'Подумай ещё' + #10#13 + 'Ты на правильном пути';   end   else   if (CheckGroup2.Checked[2])   or not (CheckGroup2.Checked[0])   or not (CheckGroup2.Checked[1])   or (CheckGroup2.Checked[3])   then   begin     Label8.Visible:=True;     Label8.Caption:='Неправильно';     end else If  (CheckGroup2.Checked[0])and(CheckGroup3.Checked[1]) then begin    Label8.Visible:=True;    Label8.Caption:='Верно';     k:=k+1;     j:=j+1;      if j=7 then memo1.visible:=true; end; end; procedure TForm1.Button7Click(Sender: TObject);    begin   Button7.enabled:=false;   If RadioGroup2.ItemIndex= 0   then begin     Label10.Visible:=True;     Label10.Caption:='Правильно';      k:=k+1;      j:=j+1;      if j=7 then memo1.visible:=true;   end   else   begin     Label10.Visible:=True;     Label10.Caption:='Неправильно';   end; end; procedure TForm1.Button8Click(Sender: TObject);   begin   Button8.Enabled:=False;   If (CheckGroup3.Checked[1])or   (CheckGroup3.Checked[2])   and not (CheckGroup3.Checked[0])   and not (CheckGroup3.Checked[3])         then   begin     Label12.Visible:=True;     Label12.Caption:='Подумай ещё!' + #10#13 + 'Ты на верном пути!';   end   else   if (CheckGroup3.Checked[0])   or not (CheckGroup3.Checked[1])   or not (CheckGroup3.Checked[2])   or (CheckGroup3.Checked[3])   then   begin     Label12.Visible:=True;     Label12.Caption:='Неправильно';     end else If  (CheckGroup3.Checked[1])and(CheckGroup3.Checked[2]) then begin    Label12.Visible:=True;    Label12.Caption:='Верно';     k:=k+1; j:=j+1;      if j=7 then memo1.visible:=true; end;   end; procedure TForm1.Button9Click(Sender: TObject);   begin   Button9.Enabled:=False;   If (CheckGroup4.Checked[0])   or (CheckGroup4.Checked[3])   and not (CheckGroup4.Checked[1])   and not (CheckGroup4.Checked[2])   then   begin      Label14.Visible:=True;      Label14.Caption:='Подумай ещё.Ты на верном пути!';   end   else if (CheckGroup4.Checked[1])or not   (CheckGroup4.Checked[0])   or not(CheckGroup4.Checked[3])   or (CheckGroup4.Checked[2])   then   begin      Label14.Visible:=True;      Label14.Caption:='Неправильно';      end   else if   (CheckGroup4.Checked[0])and(CheckGroup4.Checked[3])   then   begin      Label14.Visible:=True;      Label14.Caption:='Верно';       k:=k+1;j:=j+1;      if j=7 then memo1.visible:=true;    end; end;   procedure TForm1.result(k); begin      Memo1.text:= 'Всего вопросов - 5'+#10#13+'Правильных ответов - '+inttostr(k)      + #10#13 +'Процент правильных ответов - '+strtofloat(k/7*100) +#10#13+'Оценка - '      +    case k of                  0..2: '1';                  3: '2';                  4: '3';                  5,6:'4';                  7:'5';          end; end; end. ---------------------------------------------------------------------- Bart · 2016-11-12 14:24 Without the actual code, how could we possibly tell? Attach the project (zipped sources) here. Bart ---------------------------------------------------------------------- Artem · 2016-11-12 14:41 I attached my code here, because I couldn't  find way to attach any files. ---------------------------------------------------------------------- wp · 2016-11-12 14:46 Underneath the box into which you type your text there an "Attachments and other options" ---------------------------------------------------------------------- Artem · 2016-11-12 14:54 I tried to upload zipped file of my cose but it says that my file is too big(( ---------------------------------------------------------------------- molly · 2016-11-12 15:06 Quote from: Artem on November 12, 2016, 03:54:55 pmI tried to upload zipped file of my cose but it says that my file is too big(( - start lazarus - open your project (if not already open) - from project menu select publish project - select a directory where you want to place the published files - Press ok Zip up that directory, and attach it to you post. I doubt that your project contains so many sources that they will not fit when zipped. Most likely you also added object files and the produced executable file ? ---------------------------------------------------------------------- Artem · 2016-11-12 15:11 Yes, I added object files also it all seems like I'm stupid I did as you said but nothing did't happen, I clicked and then was waiting, clicked and then was waiting, I did it for four times, but nothing did't happend(( ---------------------------------------------------------------------- molly · 2016-11-12 15:20 Quote from: Artem on November 12, 2016, 04:11:13 pmit all seems like I'm stupid Stupid ? No, not really. Simply new to the subject (also referred to as someone being a newbie). No problem there, as we all have to start somewhere. ---------------------------------------------------------------------- Artem · 2016-11-12 15:34 Oh, thanks for this)) But I did all that you said, why did nothing happen? I'm really sorry that I even can't do that ---------------------------------------------------------------------- lainz · 2016-11-12 15:47 Quote from: Artem on November 12, 2016, 04:34:10 pmOh, thanks for this)) But I did all that you said, why did nothing happen? I'm really sorry that I even can't do that  Project > Publish project > where it says 'Destination directory' change it to $(ProjPath)\published\ It will create a new folder in the directory of your project called published, just zip that folder and upload it here. ---------------------------------------------------------------------- Artem · 2016-11-12 15:52 So you are welcome, please check it out)) ---------------------------------------------------------------------- lainz · 2016-11-12 15:57 The problem is you have the .lpr file empty! That file contains the code that starts your program. Edit that file and paste this code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program test; {$mode objfpc}{$H+} uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Interfaces, // this includes the LCL widgetset  Forms, unit1  { you can add units after this }; {$R *.res} begin  RequireDerivedFormResource:=True;  Application.Initialize;  Application.CreateForm(TForm1, Form1);  Application.Run;end. Then you need to solve the other errors. ---------------------------------------------------------------------- Artem · 2016-11-12 16:00 Oooh, finally, thank you a lot and thanks to to everybody who helped me also