Recent

Author Topic: [Solved] Stoopid Boolean Eval - What am I doing wrong?  (Read 839 times)

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1272
[Solved] Stoopid Boolean Eval - What am I doing wrong?
« on: April 11, 2019, 02:25:59 am »
I've got a TDataset accessed via FData.  Elsewhere I'm cycling through the dataset looking for stuff, and setting DisableControls/EnableControls.  In an afterscroll I want to ignore all actions that occur while ControlsDisabled is true.  So far, so good.  Oddly, the below code doesn't work

Code: Pascal  [Select][+][-]
  1.   If fmePipelineView.Loaded And Not FData.ControlsDisabled Then;
  2.   Begin
  3.      //  BOO!  I ALWAYS GET HERE, EVEN IF CONTROLSDISABLED
  4.   End;

On the other hand, the following code works as expected.

Code: Pascal  [Select][+][-]
  1.   If FData.ControlsDisabled Then
  2.     Exit;
  3.  
  4.   If fmePipelineView.Loaded Then;
  5.   Begin
  6.     // YAY, I ONLY GET HERE WHEN CONTROLS ARE NOT DISABLED
  7.   End;

I've looked at this until I'm crosseyed.  Near as I can make out, the two code segments are logically identical.  Aren't they?  I'm missing something stupid.  Any ideas?

Thanks
« Last Edit: April 11, 2019, 02:28:26 am by Mike.Cornflake »
Lazarus Trunk/FPC latest fixes on Windows 11
  I'm getting old and stale.  Slowly getting used to git, I'll get there...

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1272
Re: Stoopid Boolean Eval - What am I doing wrong?
« Reply #1 on: April 11, 2019, 02:27:46 am »
You *have* to be kidding me!!!  As soon as I hit Post I saw it.  Stupid ; after the THEN.  I've been struggling over this for ages.

Well, thanks for listening :-)

UPDATE: Yup, that resolved it.
« Last Edit: April 11, 2019, 02:32:20 am by Mike.Cornflake »
Lazarus Trunk/FPC latest fixes on Windows 11
  I'm getting old and stale.  Slowly getting used to git, I'll get there...

 

TinyPortal © 2005-2018