次の値のウォッチを追加するときに、次のコードを使用します。
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;
ウォッチリストのスクリーンショット:
レコード要素値の多次元配列の監視を適切に設定する方法は?