select date() from table_1 if date().count<=9 then begin while (not eof) and i<=9 do begin s[i]:=date()[i].values; i:=i+1; next; end; end; if date().count<=8 then begin .. s[9]:=nil end; s[9]= 第9條
ado.close; ..select date from table ado.open; i:=1; ado.first; while (not ado.eof ) do begin case i of 1: s1:= ado.fieldbyname('date').asstring; 2: s2:= ado.fieldbyname('date').asstring; 3: s3 := ado.fieldbyname('date').asstring; ... 9: s8:=ado.fieldbyname('date').asstring; end; inc(i); ado.next; end; end; 不知道你要那么多S1,S2,...s3干嘛我只好这么写了,不知道数组可不可以,如果可以那样更好了 这样就可以了,如果有第9条就有值,没有就是你的初使值空了,这个我没有测试,只是提供一个方法你自已去试一下!
if date().count<=9 then
begin
while (not eof) and i<=9 do
begin
s[i]:=date()[i].values;
i:=i+1;
next;
end;
end;
if date().count<=8 then
begin
..
s[9]:=nil
end;
s[9]=
第9條
..select date from table
ado.open;
i:=1;
ado.first;
while (not ado.eof ) do
begin
case i of
1: s1:= ado.fieldbyname('date').asstring;
2: s2:= ado.fieldbyname('date').asstring;
3: s3 := ado.fieldbyname('date').asstring;
...
9: s8:=ado.fieldbyname('date').asstring;
end;
inc(i);
ado.next;
end;
end;
不知道你要那么多S1,S2,...s3干嘛我只好这么写了,不知道数组可不可以,如果可以那样更好了
这样就可以了,如果有第9条就有值,没有就是你的初使值空了,这个我没有测试,只是提供一个方法你自已去试一下!