哈哈,又见面啦, milpas(我带着我的影子去流浪) !
解决方案 »
- dll封装的窗体里不能用TApplicationEvents?
- 求救,FastReport做报表问题还是没有角决,我再把问题说清楚点。
- 按下选中,再按下取消选中的按钮是哪个??
- 定义结构体用关键字record和packed record 有区别吗?
- 对表写循环
- 兄弟们,有没有人安装过netware 4.11的服务器 200分求教
- 用table进行查询,怎么样让它更快???
- CSDN,查询功能是垃圾!都查不了,没有以前好用了。
- 请您改错!!一定有分!
- 100分,速求一段用dialog下的打开、存储来完成备份和恢复的程序!不然明天我就被开除了!
- 如何取得一个Html页中的表格中的数据。
- 高手帮忙!怎样用程序把ie中网页的源文件得到?
PROJECT1.DLL 中导致无效页错误。
Registers:
EAX=004983c8 CS=017f EIP=0049692d EFLGS=00010283
EBX=004983c8 SS=0187 ESP=0064fc68 EBP=006501f8
ECX=00000000 DS=0187 ESI=006501f4 FS=5287
EDX=006501f4 ES=0187 EDI=006502f8 GS=0000
Bytes at CS:EIP:
68 00 04 00 00 8d 44 24 04 50 8b 43 04 50 8b 03
Stack dump:错误代码
Function changtufei(CallNum:String;Time:String;StartTime:string;TimeBlock:string;ADOConnection1:TADOConnection):string; stdcall;
var
i:integer; //查找区号使用的临时变量
ITimeLen:integer; //延时时长
Byouhui:Boolean; //是否优惠, 如果为特服号码,则该为是否计市话费.
BspecTF:Boolean; //是否为特服号码
Syhfd:string; //优惠幅度
SyhtimeS:string ; //优惠时段开始
SyhTimeE:string; //优惠时段结束
Sgnfj:string; //国内附加费
Sgjfj:string; //国外附加费
Sgnfw:string; //国内服务费
Sgjfw:String; //国外服务费
ADOTable1: TADOTable;
s:string;
CityName:string;CostRate:string;Service:String;Rate:String;Cost:String;shCost:String ;
begin
adotable1:=TADOTable.Create(nil); //创建Adotable1控件 with adotable1 do begin
Connection := ADOConnection1;
CursorType := ctStatic ;
TableName := 'syscfg';
Active := True;
end ;
AdoTable1.Locate('note','优惠幅度',[loPartialKey]);
Syhfd:=adotable1.fieldbyname('syscfg').asstring;
AdoTable1.Locate('note','优惠时段(开始)',[loPartialKey]);
SyhtimeS:=Adotable1.fieldbyname('syscfg').asstring ;
AdoTable1.Locate('note','优惠时段(结束)',[loPartialKey]);
SyhTimeE:=Adotable1.fieldbyname('syscfg').asstring ; AdoTable1.Locate('note','国内附加费',[loPartialKey]);
Sgnfj:=Adotable1.fieldbyname('syscfg').asstring ;
AdoTable1.Locate('note','国际附加费',[loPartialKey]);
Sgjfj:=Adotable1.fieldbyname('syscfg').asstring ;
AdoTable1.Locate('note','国内服务费',[loPartialKey]);
Sgnfw:=Adotable1.fieldbyname('syscfg').asstring ;
AdoTable1.Locate('note','国际服务费',[loPartialKey]);
Sgjfw:=Adotable1.fieldbyname('syscfg').asstring ; Adotable1.Close ; with adotable1 do begin
Connection := ADOConnection1;
CursorType := ctStatic ;
TableName := 'zonenum';
Active := True;
end ; i:=8 ;
while i<>2 do //查找该区号
begin
if adotable1.Locate('number',copy(CallNum,1,i),[loPartialKey]) then break;
dec(i);
end; if i=2 then Result:='该号码不可识别' //该号码不可识别
else begin CityName:=Adotable1.fieldbyname('CityName').asstring; //城市名称
CostRate:=Adotable1.fieldbyname('CostRate').asstring; //费率
ITimeLen:= Adotable1.fieldbyname('TimeBlock').asinteger; //延时时长
Byouhui:= Adotable1.fieldbyname('youhui').asboolean; //是否优惠,或者计市话费.
if ((strtoint(time)-strtoint(TimeBlock)) mod ITimeLen)<>0 then
cost:=currtostr(((strtoint(time)-strtoint(TimeBlock)) div ITimeLen +1) * strtocurr(CostRate))
else cost:=currtostr(((strtoint(time)-strtoint(TimeBlock)) div ITimeLen ) * strtocurr(CostRate));
if (Not Adotable1.fieldbyname('specTF').asboolean) and Byouhui
and (StrTodateTime(starttime)<StrTodateTime(SyhtimeE))
and (StrTodateTime(starttime)> StrTodateTime(Syhtimes)) then
cost:=currtostr(strtocurr(cost)*strtocurr(syhfd)/100) ;
if copy(CallNum,1,2)='00' then
begin
service:=currtostr(strtocurr(cost)*(strtocurr(Sgjfw)/100)) ;
Rate:=sgjfj;
cost:= currtostr(strtocurr(cost)+strtocurr(service)+strtocurr(rate));
end
else
begin
cost:=currtostr(strtocurr(cost)*(1+strtocurr(Sgnfw)/100));
cost:=currtostr(strtocurr(cost)+strtocurr(sgnfj));
end;
if Adotable1.fieldbyname('specTF').asboolean and Byouhui then
begin
shcost:=currtostr(shihuafei((strtoint(time)-strtoint(timeblock)),ADOConnection1));
cost:= currtostr(strtocurr(cost)+strtocurr(shcost));
end; result:=CityName;//+':'+CostRate+':'+Service+':'+Rate+':'+Cost+':'+shCost;
end;
adotable1.Free;
end;exports
shihuafei,changtufei;end.
临时测试用的代码