F
f19881021
Unregistered / Unconfirmed
GUEST, unregistred user!
Procedure Read_RR(StrDT1:String;StrDT2:String;var LlCount:integer;var StrCD:array of String;var DtR:array of TDateTime;var StrVRR:array of String);
var
StrSql:String;
My_temp:TADOQuery;
li:Integer;
StrV:String;
LiV:LongInt;
begin
LlCount := 0;
StrSql := 'select * from ST_RNFL_B where YMDHM>''' + StrDT1 + ''' And YMDHM<=''' + StrDT2 + ''' And V>0 order by YMDHM,STCD';
My_temp:=TADOQuery.Create(nil);
My_temp.Connection:=My_cnn;
My_temp.Active:=false;
My_temp.SQL.Clear;
My_temp.SQL.Text:=StrSql;
My_temp.Active:=true;
If My_temp.RecordCount > 0 Then
begin
My_temp.First;
LlCount := My_temp.RecordCount;
setlength(StrCD,LlCount);
Setlength(DtR,LlCount);
Setlength(StrVRR,LlCount);
li:=0;
While Not My_temp.EOF do
begin
StrCD[li] := My_temp.FieldByName('STCD').AsString;
DtR[li] := My_temp.FieldByName('YMDHM').AsDateTime;
StrV := FormatFloat('0.0',My_temp.fieldByname('V').asFloat);
Set_Real(StrV);
StrVRR[li] := StrV;
li := li + 1;
My_temp.Next;
end;
End;
My_temp.Close;
My_temp.Free;
end;
我想在函数中动态定义数组,怎么出现[Error] Main.pas(400): Incompatible types错误呢
var
StrSql:String;
My_temp:TADOQuery;
li:Integer;
StrV:String;
LiV:LongInt;
begin
LlCount := 0;
StrSql := 'select * from ST_RNFL_B where YMDHM>''' + StrDT1 + ''' And YMDHM<=''' + StrDT2 + ''' And V>0 order by YMDHM,STCD';
My_temp:=TADOQuery.Create(nil);
My_temp.Connection:=My_cnn;
My_temp.Active:=false;
My_temp.SQL.Clear;
My_temp.SQL.Text:=StrSql;
My_temp.Active:=true;
If My_temp.RecordCount > 0 Then
begin
My_temp.First;
LlCount := My_temp.RecordCount;
setlength(StrCD,LlCount);
Setlength(DtR,LlCount);
Setlength(StrVRR,LlCount);
li:=0;
While Not My_temp.EOF do
begin
StrCD[li] := My_temp.FieldByName('STCD').AsString;
DtR[li] := My_temp.FieldByName('YMDHM').AsDateTime;
StrV := FormatFloat('0.0',My_temp.fieldByname('V').asFloat);
Set_Real(StrV);
StrVRR[li] := StrV;
li := li + 1;
My_temp.Next;
end;
End;
My_temp.Close;
My_temp.Free;
end;
我想在函数中动态定义数组,怎么出现[Error] Main.pas(400): Incompatible types错误呢