怎样一次性清空一个record变量? 就是一个record变量,赋过值后怎么重新初始化,每个数据项全部为零或nil。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就是一个record变量赋过值后,重新初始化,数据项全部为0或nil。 动态数据在记录中是指针地址,和记录不一定是连续的内存空间,所以不能用fillchar一次性清空. //自己测试测试就知道了procedure TForm1.Button1Click(Sender: TObject);type TRecord = record I: Integer; A: array of Char; end;var R: TRecord;begin R.I := 10; SetLength(R.A, R.I); ShowMessage(IntToStr(Length(R.A))); FillChar(R, SizeOf(R), 0); ShowMessage(IntToStr(Length(R.A)));end; //自己测试测试就知道了procedure TForm1.Button1Click(Sender: TObject);type TRecord = record I: Integer; A: array of Char; end;var R: TRecord;begin R.I := 10; SetLength(R.A, R.I); ShowMessage(IntToStr(Length(R.A))); FillChar(R, SizeOf(R), 0); ShowMessage(IntToStr(Length(R.A)));end; //自己测试测试就知道了procedure TForm1.Button1Click(Sender: TObject);type TRecord = record I: Integer; A: array of Char; end;var R: TRecord;begin R.I := 10; SetLength(R.A, R.I); ShowMessage(IntToStr(Length(R.A))); FillChar(R, SizeOf(R), 0); ShowMessage(IntToStr(Length(R.A)));end; for i:=0 to record.count-1 do record[i].Free; delphi7 从1-200组中随机抽取6组数据,抽完了然后从又从1-194组中抽6组,并继续至抽完所有。 十万火急 关于ORACLE ORA-12154:TNS无法解析指定的连接标识符 的问题 苦难的日子结束了,散分 delphi中如何取消窗口最大化 求各位大虾救我一救,在线等,并顺带散分了,大家踊跃登陆阿 delphi5.0到delphi6.0时,quickrep出错,不知为何?在线等! 很弱的问题! 为何ACCESS文件转换为PARADOX文件后无法正确显示中文? 我的局域网上又中什么毒? 求和问题!(菜鸟的问题) 线程同步如何实现? 有关程序安装的问题!在线急等!我的給分率很高的!
procedure TForm1.Button1Click(Sender: TObject);
type
TRecord = record
I: Integer;
A: array of Char;
end;
var
R: TRecord;
begin
R.I := 10;
SetLength(R.A, R.I);
ShowMessage(IntToStr(Length(R.A)));
FillChar(R, SizeOf(R), 0);
ShowMessage(IntToStr(Length(R.A)));
end;
procedure TForm1.Button1Click(Sender: TObject);
type
TRecord = record
I: Integer;
A: array of Char;
end;
var
R: TRecord;
begin
R.I := 10;
SetLength(R.A, R.I);
ShowMessage(IntToStr(Length(R.A)));
FillChar(R, SizeOf(R), 0);
ShowMessage(IntToStr(Length(R.A)));
end;
procedure TForm1.Button1Click(Sender: TObject);
type
TRecord = record
I: Integer;
A: array of Char;
end;
var
R: TRecord;
begin
R.I := 10;
SetLength(R.A, R.I);
ShowMessage(IntToStr(Length(R.A)));
FillChar(R, SizeOf(R), 0);
ShowMessage(IntToStr(Length(R.A)));
end;
record[i].Free;