Forum > Beginners

conditions not caried out(solved)

(1/1)

pentilisea:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.ToggleBox3Change(Sender: TObject);begin  if ToggleBox3.Checked then begin    ToggleBox3.Caption := 'Neighbors-2';    ToggleBox3.Color := clSkyBlue;    ToggleBox3.Font.Color:=clTeal;    end else begin    ToggleBox3.Caption := 'Neighbors-2';    ToggleBox3.Color := clDefault;    ToggleBox3.Font.Color := clDefault;   end;  end;                        procedure TForm1.Button49Click(Sender: TObject);begin  If ToggleBox2.Checked = True  Then begin  ToggleBox3.Checked := False;  Button4.Click;  Button39.Click;  Button33.Click;    Button49.Font.Color := clGreen;  end;   If ToggleBox3.Checked = True  Then begin  ToggleBox2.Checked := False;  Button4.Click;  //caried out  Button39.Click; //caried out  Button33.Click; //caried out  Button51.Click; //additional task not caried out  Button84.Click; //additional task nor caried out   Button49.Font.Color := clGreen; //these lines are caried out  Button49.Color := clLime;  end;  end;    

Thanks for your attention.


Klaus

howardpc:
You should show a compilable project that shows the problem, not a snippet that probably does not contain the bug.

pentilisea:
hmhmhm

right you are - numbers mixed .....

thanks for the hint

Navigation

[0] Message Index

Go to full version