Lazarus

Programming => Databases => Topic started by: talorigomat on March 16, 2017, 01:14:27 pm

Title: Sigsegv error at 9c087
Post by: talorigomat on March 16, 2017, 01:14:27 pm
When the review button is clicked (the one under the assig button) and then the former that is displayed closed I get the sigsegv error.  If I click any of the other review buttons the error doesn't occur.  All the buttons call the same procedure to display the same format

I've tracked the error down to the following procedure:

Code: Pascal  [Select][+][-]
  1. procedure TfrmGuidance.btnSpecReviewClick(Sender: TObject);
  2. var
  3.   currAss :largeint;
  4. begin
  5.   if dmGuidance.qryReviewSpec.RecordCount <> 0 then
  6.     currAss := dmGuidance.qryReviewSpec.FieldByName('assid').AsInteger;
  7.   OpenReview(dmGuidance.dsrReviewSpec);
  8.   if dmGuidance.qryReviewSpec.RecordCount <> 0 then
  9.       dmGuidance.qryReviewSpec.Locate('assid',currAss,[]);
  10. end;

The error occurs when the statement dmGuidance.qryReviewSpec.Locate('assid',currAss,[]) is executed. 

The database is in firebird 2.5 and I'm using Lazarus 1.6.4
Title: Re: Sigsegv error at 9c087
Post by: talorigomat on March 16, 2017, 02:00:04 pm
If a change the procedure so that it displays a message before executing the locate statement

Code: Pascal  [Select][+][-]
  1.   .........
  2.   OpenReview(dmGuidance.dsrReviewSpec);
  3.   if dmGuidance.qryReviewSpec.RecordCount <> 0 then
  4.   begin
  5.     ShowMessage(IntToStr(CurrAss));
  6.     dmGuidance.qryReviewSpec.Locate('assid',currAss,[]);
  7.   end;
  8. .....
  9.  
   

then the error doesn't occur. %)
Title: Re: Sigsegv error at 9c087
Post by: talorigomat on March 16, 2017, 06:30:53 pm
 Issuing an application.ProcessMessages command be executing the locate statement seemed to solve the problem.  I'm still interested in hearing from others as I didn't have this problem in the previous version of Lazarus.
Code: Pascal  [Select][+][-]
  1.  .........
  2.   OpenReview(dmGuidance.dsrReviewSpec);
  3.   if dmGuidance.qryReviewSpec.RecordCount <> 0 then
  4.   begin
  5.     application.ProcessMessages;
  6.     dmGuidance.qryReviewSpec.Locate('assid',currAss,[]);
  7.   end;
  8. .....
  9.  
TinyPortal © 2005-2018