Forum > Debugger

[Solved] Error 'External: SIGSEGV'

<< < (2/2)

Leledumbo:

--- Quote ---My lazarus is not doing that. I have to put the "CreateForm" manually for each form.

--- End quote ---
Bug? What's your version?

sanor:
Lazarus 0.9.28.2 beta
FPC 2.2.4

dmdmaasz6:
Hello Guys im a student from namibia and im doging my end year  grade 12 project in lazarus 0.9.28.2 and I created a mySQLdatabase program but every time I use my save button wwith the following code :
procedure TForm2.Button1Click(Sender: TObject);
begin
  Form2 := TForm2.Create(nil);
  try
    Form2.DataSource1.DataSet := CatQuery1;
    CatQuery1.ParseSQL:=true;
    CatQuery1.ReadOnly:=false;
    CatQuery1.Open;
  finally
    CatQuery1.UpdateMode:=upWhereChanged;
    CatQuery1.ApplyUpdates;
    IMTransaction1.Commit;
    Form2.Free;
    CatQuery1.Close;
    CatQuery1.ParseSQL:=false;
    CatQuery1.ReadOnly:=true;
    Form2.ShowModal;
  end;
end;                     

It gives the error 'External: SIGSEGV' can you guys plz assist me in my problem cause ive tried and tried but the lack of entire knowledge concerning this error has left me desperate for help.
Any input will be much appreciated.

Blaazen:
 :o

--- Code: ---procedure TForm2.Button1Click(Sender: TObject);
begin
  Form2 := TForm2.Create(nil);
  try
    Form2.DataSource1.DataSet := CatQuery1;
    CatQuery1.ParseSQL:=true;
    CatQuery1.ReadOnly:=false;
    CatQuery1.Open;
  finally
    CatQuery1.UpdateMode:=upWhereChanged;
    CatQuery1.ApplyUpdates;
    IMTransaction1.Commit;
    Form2.Free;
    CatQuery1.Close;
    CatQuery1.ParseSQL:=false;
    CatQuery1.ReadOnly:=true;
    Form2.ShowModal;
  end;
end;       

--- End code ---
this is very, very bad.

You cannot create Form2 by click on Button which is placed on the Form2 !

You cannot do Form2.Free and few lines later do Form2.ShowModal because Form2 does not exists at that moment!

I guess that all Forms in your project are autocreated. Try:


--- Code: ---procedure TForm2.Button1Click(Sender: TObject);
begin
  //Form2 := TForm2.Create(nil);
  try
    Form2.DataSource1.DataSet := CatQuery1;
    CatQuery1.ParseSQL:=true;
    CatQuery1.ReadOnly:=false;
    CatQuery1.Open;
  finally
    CatQuery1.UpdateMode:=upWhereChanged;
    CatQuery1.ApplyUpdates;
    IMTransaction1.Commit;
    //Form2.Free;
    CatQuery1.Close;
    CatQuery1.ParseSQL:=false;
    CatQuery1.ReadOnly:=true;
    //Form2.ShowModal;
  end;
end;       

--- End code ---

and Form2.ShowModal must be done elsewhere - in Form1.ButtonXY click?

talitaedwiges:
SORRY BUT I DON'T KNOW HOW TO CREATE A NEW TOPIC!

Estou criando uma API de raltorios no lazarus + fortes, But when I try to call my Form from the report TReportTeste.Create(nil) the system displays the SIGSEGV error.

This is an API using the strong report.


Navigation

[0] Message Index

[*] Previous page

Go to full version