把foxpro代码转为delphi代码

gzj8143586 2003-10-16 10:33:28
wait wind "正在汇总,请稍候..." timeout 0.5

sele men_time
yyear=year(thisform.text1.value)
mmonth=month(thisform.text1.value)
index on person_no tag person_no for year(date)=yyear and month(date)=mmonth and !empt(allt(name))

dddate=thisform.text1.value-day(thisform.text1.value)+1
SET RELATION TO allt(str(year(ddate))) INTO Weekend ADDITIVE
SET RELATION TO class INTO Class ADDITIVE
**************************************************************************************

do case
case month(dddate)=1 or month(dddate)=3 or month(dddate)=5 or month(dddate)=7 or month(dddate)=8;
or month(dddate)=10 or month(dddate)=12
dday=31
case month(dddate)=4 or month(dddate)=6 or month(dddate)=9 or month(dddate)=11
dday=30
case month(dddate)=2
if year(dddate)/4=int(year(dddate)/4)
dday=29
else
dday=28
endif
endcase


repl all day with 0
for i=1 to dday
hol=seek(dddate,"hols")
if hol
l=iif(len(allt(str(i)))=1,"0"+allt(str(i)),allt(str(i)))
repl all day with day+1 for date_in<dddate
else
l=iif(len(allt(str(i)))=1,"0"+allt(str(i)),allt(str(i)))
repl all day with day+1 for d&l>0
endif
dddate=dddate+1
endfor
*************************************************************************************************

dddate=thisform.text1.value-day(thisform.text1.value)+1
l=allt(str(month(dddate)))
repl all wday with 0,p1 with 0,p2 with 0,p3 with 0,p4 with 0,t1 with 0,t2 with 0,t3 with 0,;
t4 with 0,t01 with 0,time with 0,tprice with 0,jt with 0
repl all wday with weekend.m&l-(dday-day) for (weekend.m&l-(dday-day))>0


for i=1 to dday
repl all check with .f.
l=iif(len(allt(str(i)))=1,"0"+allt(str(i)),allt(str(i)))

hol=seek(dddate,"hols")
if hol
if hols.again=1
a=2
else if hols.again=0
a=3
endif

repl all p4 with p4+8*class.modulus for date_in<dddate and d&l=0
repl all p4 with p4+(d&l*(a-1)+8)*class.modulus for date_in<dddate and d&l>0 and d&l<=8
repl all p4 with p4+a*d&l*class.modulus for date_in<dddate and d&l>8
repl all p4 with p4+8*tclass for date_in<dddate and d&l<=0 and class=0
repl all p4 with p4+(d&l*(a-1)+8)*tclass for date_in<dddate and d&l>0 and d&l<=8 and class=0
repl all p4 with p4+a*d&l*tclass for date_in<dddate and d&l>8 and class=0
repl all t4 with t4+d&l for date_in<dddate and day>0


else
if cdow(dddate)="Saturday" or cdow(dddate)="Sunday"
repl all t3 with t3+iif(d&l>10,10,d&l),t1 with t1+iif(d&l>10,d&l-10,0),wday with (wday-1),check with .t. for wday>0 and d&l<>0
repl all t1 with t1+d&l for d&l<=8 and !(check)
repl all t1 with t1+8,t2 with t2+(d&l-8) for d&l>8 and d&l<=10 and !(check)
repl all t1 with t1+(d&l-2),t2 with t2+2 for d&l>10 and !(check)
else
repl all t1 with t1+d&l for d&l<=8 and jprice<=0
repl all t1 with t1+8,t2 with t2+(d&l-8) for d&l>8 and d&l<=10
repl all t1 with t1+(d&l-2),t2 with t2+2 for d&l>10
endif
repl all t01 with t01+(d&l-10) for d&l>10
endif
repl all time with time+d&l
dddate=dddate+1
endfor

repl all t1 with t1-t01
repl all t1 with time-t2-t3-t4-t01 for jtime=0
repl all p1 with t1*class.modulus,p2 with t2*class.modulus*1.5,p3 with t3*class.modulus*2,;
p01 with t01*class.modulus for jtime<=0

repl all jtime with 0 for jprice<=0

repl all ttime with time-jtime for (time-jtime)>0
repl all ttime with 0 for (time-jtime)<=0

repl all p4 with p4-t4*class.modulus for jtime>0 and date_in<=dddate
repl all p4 with 0 for time=0

repl all tprice with ttime*class.tmod for jtime>0

repl all p1 with tprice for jtime>0 and left(person_no,3)<>"301" and left(person_no,5)<>"50202"

repl all p1 with t1*tclass p2 with t2*tclass, p3 with t3*tclass,p01 with t01*tclass for class=0


repl all tprice with p1+p2+p3+p01+p4 for jtime<=0
repl all p01 with 0 for jtime>0
repl all t1 with time-t2-t3-t4-t01 for jprice>0
repl all Tprice with Tprice+p4 for jtime>0
repl all jt with 1.4*time-tprice-jprice for 1.4*time-tprice-jprice>0
*********************************************************************************************
repl all slry with round(tprice+jprice+hsjt+jt+blgz,0)
repl all price with round(slry+bfkf+tcf-flf-htf-bwfk-czfk-qtfk-fkjj-fkczjj-kjjj-shqjj-qtjj-shbx-kcf,0)


*********************************************************************************************
repl all m100 with int(price/100) for price>0
repl all m50 with int((price-m100*100)/50) for price>0
repl all m20 with int((price-m100*100-m50*50)/20) for price>0
repl all m10 with int((price-m100*100-m50*50-m20*20)/10) for price>0
repl all m5 with int((price-m100*100-m50*50-m20*20-m10*10)/5) for price>0
repl all m2 with int((price-m100*100-m50*50-m20*20-m10*10-m5*5)/2) for price>0
repl all m1 with int((price-m100*100-m50*50-m20*20-m10*10-m5*5-m2*2)) for price>0

set rela to
wait wind "汇总结束..."

index on person_no tag person_no


...全文
37 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
gzj8143586 2004-02-19
  • 打赏
  • 举报
回复
结贴
tanqth 2003-10-27
  • 打赏
  • 举报
回复
转什么转,你重新写得了。
jingbianfc 2003-10-27
  • 打赏
  • 举报
回复
我也想啊,这应该不可能的,数据库可以转换,但程序不行,代码不同,语法不同,太多不同。。。。
newnewworm 2003-10-17
  • 打赏
  • 举报
回复
部分是依靠Delphi的逻辑判断语句
部分是依靠SQL语句
两者结合就可以搞定你的forpro转换Delphi的目的!
lxtnt 2003-10-17
  • 打赏
  • 举报
回复
首新这不叫转,而是用DELPHI编。所以你必须把所有信息提供完毕:如数据库、处理结果要求。。。说清!

gzj8143586 (高志坚)
tiger19760407 2003-10-17
  • 打赏
  • 举报
回复
好长呀!
tanqth 2003-10-17
  • 打赏
  • 举报
回复
在delphi中,使用查询对数据库操作。具体的自己摸索吧
niska 2003-10-17
  • 打赏
  • 举报
回复
够晕啊~
空中居士 2003-10-16
  • 打赏
  • 举报
回复
这样长的代码,目的是什么,一点注释都没有,也不说明目的,很难看懂。
在delphi中,使用查询对数据库操作。具体的自己摸索吧
pankun 2003-10-16
  • 打赏
  • 举报
回复
好长一片...算了...

2,495

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧