Debugging 如何设置监视多维记录数组元素值?
在添加watch的值时使用以下代码:Debugging 如何设置监视多维记录数组元素值?,debugging,freepascal,lazarus,Debugging,Freepascal,Lazarus,在添加watch的值时使用以下代码: A[1, 1].IsX 并将断点放在下面的注释行上,监视列表显示以下消息: Type array [1..3] of TBLOCK is not a structure or union type. 而不是显示记录元素值。以下是示例代码: type TBlock = record IsX: Boolean; IsO: Boolean; IsEmpty: Boolean; end; procedure TForm1.But
A[1, 1].IsX
并将断点放在下面的注释行上,监视列表显示以下消息:
Type array [1..3] of TBLOCK is not a structure or union type.
而不是显示记录元素值。以下是示例代码:
type
TBlock = record
IsX: Boolean;
IsO: Boolean;
IsEmpty: Boolean;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
A: array[1..9, 1..3] of TBlock;
begin
A[1, 1].IsX := True;
// add watch for A[1, 1].IsX and set the breakpoint on the following line
if A[1, 1].IsX then
ShowMessage('Prevent against debugger elimination.');
end;
观察列表中的屏幕截图:
如何正确设置多维记录数组元素值的手表?请按如下方式添加手表:
A[1][1].IsX
我无法告诉您为什么原始方式显示该错误消息,但上面的方式对我有效: