当然可以
看看一下代码
1。定义一个结构
///////////////////自定义的欠费统计结构
towe=record
name:shortstring;
fee0:shortstring;
//当月费用
fee1:shortstring;
//total费用
end;
poweary=^toweary;
toweary=array[0..20] of towe;
powerecords=^towerecords;
towerecords=record
count:longint;
oweary:toweary;
end;
2。需要两个函数
function Tstat_acf.varianttoowerecords(v: olevariant): towerecords;
var
p
ointer;
begin
p:=vararraylock(v);
move(p^,result,sizeof(towerecords));
vararrayunlock(v);
end;
3。
服务端
function owestat:varaint;
begin
towerecords:=////给他附值
v:=vararraycreate([0,sizeof(towerecords)],varbyte);
P:=vararraylock(v);
move(owerecords,p^,sizeof(towerecords));
vararrayunlock(v);
result:=v;
end;
4。客户端接收
var
v:variant;
v:=socketconn.AppServer.owestat(owedate);///返回统计值
owerecords:=varianttoowerecords(v);