Recent

Author Topic: [SOLVED]Unusual compile error... On Click event from a TDBCheckBox  (Read 1561 times)

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 397
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
For some reason in one unit, Lazarus is confused or I confused Laz.  I have a procedure for this that worked fine until today but added an on click event for a TJvDBSearchEdit. It thinks that the click event is for a TDBCheckBox and won't create a new procedure for the TJvDBSearchEdit.

I tried saving and recreating but something's a bit haywire.  Anybody know how to reset this somehow so Laz knows to create a new procedure for the TJvDBSearchEdit instead of the TDBCheckBox???
« Last Edit: October 12, 2025, 09:24:01 pm by 1HuntnMan »

wp

  • Hero Member
  • *****
  • Posts: 13206
Re: Unusual compile error... On Click event from a TDBCheckBox
« Reply #1 on: August 17, 2025, 06:00:42 pm »
You say: You have a TDBCheckbox and a TJvDBSearchEdit on the form (maybe more). You select the OnClick event of the TJvDBSearchEdit in the Object Inspector, click the '...' - the IDE should add an OnClick handler to TJvDBSearchEdit, but it adds it to the DBCheckbox? In other words: the right-hand side of the OnClick event of the TJvDBSearchEdit in the Object Inspector is empty, but the handler is listed at the right-hand side of OnClick the TDBCheckbox? How is the procedure named, TForm1.JvDBSearchEdit1Click or TForm1.DBCheckbox1Click?

Have never seen such a behaviour... Could it be that you renamed the two controls and mixed them up? I.e, you wanted to rename the TJvDBSearchEdit but had selected the DBCheckbox?

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 397
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Unusual compile error... On Click event from a TDBCheckBox
« Reply #2 on: August 17, 2025, 08:56:49 pm »
WP, trying to eliminate the issue by commenting out both procedures: DBChkBxSOAuth and JvDBIndexSrchSOKeyUp. Also, commented them out from the procedure listings above the private, public and implementation.  Then attempt to recompile and get an error at the next procedure down from DBChkBxSOAuthClick procedure which is a DBEditRQByEmailDBlClick short procedure that allows the user to double click to launch the URL in their web browser. Same error for each procedure: Error: Illegal expression.

I've been trying to search the whole unit for maybe a missing semi-colon at the end of a procedure.  I'm thinking to save time is recreate the whole unit and add everything step-by step to figure actually where the actual error first occurs.

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 397
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Unusual compile error... On Click event from a TDBCheckBox
« Reply #3 on: August 17, 2025, 09:07:41 pm »
Here's a better explanation.  The DbChkBxSOAuthClick is all commented out and saved.  Exit Laz and then startup Laz.  Then if goto the properties/events for the DBChkBxSOAuth OnClick ... and click it, it doesn't create an empty procedure, the cursor goes to the next procedure below where the original procedure used to be that's commented out.  But nothing appears in the OnClick box for that component.

I'm going to quit wasting my time and yours, and recreate the complete unit.  I can do that fairly easily because it's not a lot of coding.

jamie

  • Hero Member
  • *****
  • Posts: 7302
Re: Unusual compile error... On Click event from a TDBCheckBox
« Reply #4 on: August 17, 2025, 09:49:11 pm »
Did you create a sub folder in your project folder and copy a current project over to that as a backup for example?

If you did, it's more than likely that folder is getting seen at various stages of build time and you are getting the wrong info.

 I know this already happen to another user that did this and that was the cause of their issue, changes being made were being ignored from the behavior.

Jamie
The only true wisdom is knowing you know nothing

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 397
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Unusual compile error... On Click event from a TDBCheckBox
« Reply #5 on: August 17, 2025, 11:01:22 pm »
Woops, yup, did that.  Well, I have a subfolder called Documentation but it's just screen shots, no code.  But, the backup folder is created by Lazarus and I've used to put backups of units, etc.  Can I wipe out the backup folder and then when I launch Laz and save modifications, Laz will make it's backups and I myself never put my own in that folder only let Laz do that.  If I need to backup the project separately, make it in a folder that's not part of the project folder.

jamie

  • Hero Member
  • *****
  • Posts: 7302
Re: Unusual compile error... On Click event from a TDBCheckBox
« Reply #6 on: August 17, 2025, 11:33:24 pm »
Look in your project inspector and ensure all paths for your units are pointing to the base project folder.
jamie
The only true wisdom is knowing you know nothing

BildatBoffin

  • New Member
  • *
  • Posts: 40
Re: Unusual compile error... On Click event from a TDBCheckBox
« Reply #7 on: August 18, 2025, 11:26:34 am »
close Laz and try to remove the associated events by editing the matching *lfm. The reopen Laz and using the inspector, set the right ones again.

Otherwise if you use git, ala "one change one commit", you can do `git checkout HEAD~1`, and look a bit at the diff to see what's going on..

 

TinyPortal © 2005-2018