olddata是什么???
dim oldData as new collection
dim i as integer
dim j as integer
dim curSum as double
for i=0 to oldData.count-3
    curSum=0
    for j=0 to 4
       curSum=oldData(i+j)+curSum
    next j
    newData.add(surSum/5)
next i 
这个是不是啊???

解决方案 »

  1.   

    dim OldData() as single
    dim newData() as single
    dim i as integer
    i=0
    j=0
    for i to ubound(oldData)-2 
    curSum=0; 
     for j=0 to 4 
     curSum= cursum+ cSng(oldData(i+j))) 
     next j
     preserve redim newData(ubound(newData)+1) newData(ubound(newData)+1)= CSng(curSum/5)) 
    next i
      

  2.   

    dim OldData() as single 
    dim newData() as single 
    dim i as integer 
    for i =0 to ubound(oldData)-3
    curSum=0; 
    for j=0 to 4 
    curSum= cursum+ cSng(oldData(i+j))) 
    next j 
    redim preserve newData(ubound(newData)+1) newData(ubound(newData)+1)= CSng(curSum/5)) 
    next i
      

  3.   

    Why not use Rational Rose??