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
If fmePipelineView.Loaded And Not FData.ControlsDisabled Then;
Begin
// BOO! I ALWAYS GET HERE, EVEN IF CONTROLSDISABLED
End;
On the other hand, the following code works as expected.
If FData.ControlsDisabled Then
Exit;
If fmePipelineView.Loaded Then;
Begin
// YAY, I ONLY GET HERE WHEN CONTROLS ARE NOT DISABLED
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