for i:=2 to 100 do
begin
if data.cells[i,1].value=null then
begin
data.cells[i,1].value:=edit6.Text;
data.cells[i,2].value:=timetostr(time);
break;
end;
end;
//往excel表格中写内容,编译通过,为什么表格仍然为空?
begin
if data.cells[i,1].value=null then
begin
data.cells[i,1].value:=edit6.Text;
data.cells[i,2].value:=timetostr(time);
break;
end;
end;
//往excel表格中写内容,编译通过,为什么表格仍然为空?
if data.cells[2,1].value=null then
begin
data.cells[2,1].value:=edit6.Text;
data.cells[2,2].value:=timetostr(time);
end
else if data.cells[3,1].value=null then
begin
data.cells[3,1].value:=edit6.Text;
data.cells[3,2].value:=timetostr(time);
end
else if data.cells[4,1].value=null then
begin
data.cells[4,1].value:=edit6.Text;
data.cells[4,2].value:=timetostr(time);
end
……
改用null后倒是没错误了,但运行没结果
varIsNull也试过,和=null一个效果
VarIsNull檢查其所指向的內容是否為空
首先全部填入' '(空格),相当于给一个初始化值。然后用data.cell[x,y]=' '应该就可以了。
问题就出在这里,不要这句就能写进文件,可这句究竟怎么改?