如何在调试器中显示TStringList的内容? [英] How can I show the contents of a TStringList in the debugger?
问题描述
我想在调试应用程序时显示TStringList的整个内容。
相反,我只是得到指针。 Flist只显示地址。
I want to display the entire content of a TStringList while debugging the application. Instead I just get pointers. The Flist is showing only the address.
推荐答案
我现在使用可视化程序,我有D2010。我曾经使用一个名为CArray的函数,它将返回一个字符串数组。如果我将CArray(MyStringList)添加到监视窗口,我将能够检查字符串列表的内容。我以前习惯写VB6代码,我喜欢各种'C'函数转换成一个有用的类型。用于字符串列表的CArray和ClientDataset字段的CArray主要用于调试。
I use the visualizers now that I have D2010. I used to use a function I called CArray that would return an array of strings. If I added CArray(MyStringList) to the watch window, I would be able to examine the contents of the string list. I used to be employed to write VB6 code and I sort of liked the various 'C' functions for converting to a useful type. CArray for stringlists and CArray for ClientDataset fields were mostly useful for debugging.
function CArray(List: TStrings): TStrArray; Overload;
var i,
iCount: Integer;
begin
iCount := List.Count;
SetLength(Result, iCount);
for i := 0 to Pred(iCount) do Result[i] := List[i];
end;
这篇关于如何在调试器中显示TStringList的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!