如何在Delphi断点属性中使用条件

发布于 2024-10-05 00:23:01 字数 165 浏览 4 评论 0原文

我发现当达到某些特定条件时,嵌套循环会失败,不知何故,当 I = 1、J = 3 和 k = 5 时,

我尝试右键单击断点,并在我设置的条件下设置

(I = 1) 和 (J = 3) AND (K = 5)

无论如何,断点不会停止...

出了什么问题?

I found that a nested loop fails when some particular condition is reached, somehow when I = 1, J = 3 and k = 5

I tried to right click on the breakpoint and in the condition I set

(I = 1) and (J = 3) AND (K = 5)

anyway the breakpoint doesn't stop...

What is wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

萌梦深 2024-10-12 00:23:02

在满足条件之前在一行代码上设置断点并按 F8 单步执行?

Set breakpoint on a line of code before the condition is met and step through with F8?

芯好空 2024-10-12 00:23:01

我刚刚在 D2007 中尝试过,效果很好。你用的是什么版本?

procedure TForm85.FormClick(Sender: TObject);
var i,j,k : integer;
    z:integer;
begin

  for i := 0 to 10 do
  for j := 0 to 10 do
  for k := 0 to 10 do
  BEGIN
    z := z + i * j * k; // breakpoint on this line.
  END;

  ShowMessage(IntToStr(z));
end;

您是否考虑过,由于条件不满足,可能无法到达断点?

I've just tried that in D2007 and it works fine. what version are you using?

procedure TForm85.FormClick(Sender: TObject);
var i,j,k : integer;
    z:integer;
begin

  for i := 0 to 10 do
  for j := 0 to 10 do
  for k := 0 to 10 do
  BEGIN
    z := z + i * j * k; // breakpoint on this line.
  END;

  ShowMessage(IntToStr(z));
end;

Have you considered that the breakpoint may not be reached because the condition is not being met?

帥小哥 2024-10-12 00:23:01

我认为您确实将断点添加为中断断点

要验证这一点,

  • 请打开“断点”属性窗口,
  • 单击“高级”
  • ,确保选中“断点”复选框。

You did add the breakpoint as a Breaking breakpoint I assume.

To verify this

  • open the Breakpoint properties window
  • click on Advanced
  • make sure the Break checkbox is checked.
玩套路吗 2024-10-12 00:23:01

可能根据您的代码

(I = 1) and (J = 3) AND (K = 5)

可能永远不会同时获得这个值

May be according to your code

(I = 1) and (J = 3) AND (K = 5)

may never get this values at same time

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文