R
RGKJ
Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码如下:
server:
function TQueueDataServer.GetGroupList: OleVariant;
var
GroupSet:TGroupSet;
i, len: integer;
strs:TStrings;
begin
strs:=TStringList.Create ;
GroupSet:=TGroupSet.Create('WorkGroup.ini');
try
GroupSet.proGetGroupList(strs);
len:=strs.Count ;
Result := VarArrayCreate([0, len - 1], varVariant);
for i := 0 to len - 1do
Result := strs.Strings;
finally
GroupSet.Free ;
strs.Free;
end;
end;
Client:
var
templeVariant;
i:integer;
strs:TStrings;
begin
Strs:=TStringList.Create ;
Temp:=VarArrayCreate([0,1],varvariant);
temp:=Socketconnection1.AppServer.GetGroupList;
for i:=0 to 1do
strs.Add(Temp);
编译能通过,运行时出错:"invalid argument",
为什么?请各位大虾帮我分析一下,应该怎么写?
server:
function TQueueDataServer.GetGroupList: OleVariant;
var
GroupSet:TGroupSet;
i, len: integer;
strs:TStrings;
begin
strs:=TStringList.Create ;
GroupSet:=TGroupSet.Create('WorkGroup.ini');
try
GroupSet.proGetGroupList(strs);
len:=strs.Count ;
Result := VarArrayCreate([0, len - 1], varVariant);
for i := 0 to len - 1do
Result := strs.Strings;
finally
GroupSet.Free ;
strs.Free;
end;
end;
Client:
var
templeVariant;
i:integer;
strs:TStrings;
begin
Strs:=TStringList.Create ;
Temp:=VarArrayCreate([0,1],varvariant);
temp:=Socketconnection1.AppServer.GetGroupList;
for i:=0 to 1do
strs.Add(Temp);
编译能通过,运行时出错:"invalid argument",
为什么?请各位大虾帮我分析一下,应该怎么写?