以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  代码简化问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=3748)

--  作者:ybmjy
--  发布时间:2009/7/30 12:22:00
--  代码简化问题
 这部份代码能简化吗,该怎样简化

 

dim a as Double

dim c as Double

dim d as Double

dim f as Double

dim g as Double

dim h as Double

dim m as Double

dim i as Double

dim b as String="1"

a=dataTables("发票管理").Compute("Sum(cl)","y = \'"& b &"\' ")

currenttable(0,"材料")=a

c=dataTables("发票管理").Compute("Sum(cl)","y = \'"& b &"\' ")

currenttable(0,"收入")= c

d=dataTables("发票管理").Compute("Sum(fl)","y = \'"& b &"\' ")

currenttable(0,"fl")= d

f=dataTables("发票管理").Compute("Sum(sf)","y = \'"& b &"\' ")

currenttable(0,"sf")=f

g=dataTables("发票管理").Compute("Sum(jm)","y = \'"& b &"\' ")

currenttable(0,"jm")= g

h=dataTables("发票管理").Compute("count(y)","y = \'"& b &"\' ")

currenttable(0,"srfp")= h

m=dataTables("流水帐").Compute("count(zc)","月 = \'"& b &"\' ")

currenttable(0,"zcfp")= m

i=dataTables("流水帐").Compute("Sum(zc)","月 = \'"& b &"\' ")

currenttable(0,"zc")=i


--  作者:狐狸爸爸
--  发布时间:2009/7/30 12:27:00
--  

With dataTables("发票管理")
    currenttable(0,"材料")= .Compute("Sum(cl)","y = 1")

    currenttable(0,"收入")= .Compute("Sum(cl)","y = 1")
    ...
End With


--  作者:czy
--  发布时间:2009/7/30 12:31:00
--  
dim a,c,d,e,f,g,h,m,i as Double

其它简化好象没多大意思。
--  作者:ybmjy
--  发布时间:2009/7/30 13:36:00
--  

谢谢