回复 40楼 sdta
对对对,我运行了我仿制的程序一下,都变成了35元。[此贴子已经被作者于2016-12-24 23:37编辑过]
程序代码:close databases all
use jmb in 0
cstr=""
scan
cstr=cstr+alltrim(jm)+" N(10,2),"
endscan
cstr=left(cstr,len(cstr)-1)
create cursor jjtj (ny n(6),num n(4),xm c(8),bm c(15),hj n(12,2),&cstr)
append from jjd fields num,xm,bm
index on num tag num
use jj in 0
select jj
set relation to num into jjtj
scan
replace (alltrim(jj.奖名)) with jj.金额 in jjtj
endscan
set relation to
* 行小计
select jjtj
cstr=""
for i=6 to fcount()
cstr=cstr+"+"+field(i)
endfor
replace all hj with evaluate(cstr)
browse

程序代码:close databases all
select distinct num,xm,bm from jj where 金额>0 into array anum
use jmb in 0
select jmb
cstr=""
scan
cstr=cstr+alltrim(jm)+" N(10,2),"
endscan
cstr=left(cstr,len(cstr)-1)
create cursor jjtj (ny n(6),num n(4),xm c(8),bm c(15),hj n(12,2),&cstr)
append from array anum fields num,xm,bm
index on num tag num
select jj
set relation to num into jjtj
scan for 金额>0
replace (jj.奖名) with evaluate(jj.奖名)+jj.金额 in jjtj
endscan
set relation to
* 行小计
select jjtj
cstr=""
for i=6 to fcount()
cstr=cstr+"+"+field(i)
endfor
replace all hj with evaluate(cstr)
browse[此贴子已经被作者于2016-12-25 01:48编辑过]
