Recent

Author Topic: conditions not caried out(solved)  (Read 244 times)

pentilisea

  • New Member
  • *
  • Posts: 34
conditions not caried out(solved)
« on: March 17, 2023, 10:18:31 am »
Hi,
got stuck again unfortunately.

I've got 3 toggle buttons and all work as they should.

Then I have 37 buttons to react on the status of ToggleButton2
and ToggleButton3.

With ToggleButton2 checked everything works fine.

Now the problem:

If ToggleButton3 is checked Buttos49 is asked to carry out
some additional task - but only the task of ToggleButton2
is caried out regardless of ToggleButton2 is checked ...

So, what I'm doin wrong?


Code: Pascal  [Select][+][-]
  1. procedure TForm1.ToggleBox3Change(Sender: TObject);
  2. begin
  3.   if ToggleBox3.Checked then begin
  4.     ToggleBox3.Caption := 'Neighbors-2';
  5.     ToggleBox3.Color := clSkyBlue;
  6.     ToggleBox3.Font.Color:=clTeal;
  7.  
  8.  
  9.   end else begin
  10.     ToggleBox3.Caption := 'Neighbors-2';
  11.     ToggleBox3.Color := clDefault;
  12.     ToggleBox3.Font.Color := clDefault;
  13.  
  14.   end;
  15.  
  16.  
  17. end;                      
  18.  
  19.  
  20. procedure TForm1.Button49Click(Sender: TObject);
  21. begin
  22.   If ToggleBox2.Checked = True  Then begin
  23.   ToggleBox3.Checked := False;
  24.   Button4.Click;
  25.   Button39.Click;
  26.   Button33.Click;
  27.  
  28.  
  29.   Button49.Font.Color := clGreen;
  30.   end;
  31.  
  32.   If ToggleBox3.Checked = True  Then begin
  33.   ToggleBox2.Checked := False;
  34.   Button4.Click;  //caried out
  35.   Button39.Click; //caried out
  36.   Button33.Click; //caried out
  37.   Button51.Click; //additional task not caried out
  38.   Button84.Click; //additional task nor caried out
  39.  
  40.   Button49.Font.Color := clGreen; //these lines are caried out
  41.   Button49.Color := clLime;
  42.   end;
  43.  
  44.  
  45. end;  
  46.  


Thanks for your attention.


Klaus
« Last Edit: March 17, 2023, 02:46:09 pm by pentilisea »

howardpc

  • Hero Member
  • *****
  • Posts: 4133
Re: conditions not caried out
« Reply #1 on: March 17, 2023, 11:42:18 am »
You should show a compilable project that shows the problem, not a snippet that probably does not contain the bug.

pentilisea

  • New Member
  • *
  • Posts: 34
Re: conditions not caried out
« Reply #2 on: March 17, 2023, 02:45:39 pm »
hmhmhm

right you are - numbers mixed .....

thanks for the hint

 

TinyPortal © 2005-2018