| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 376 人关注过本帖
标题:挑毛病(数组)
只看楼主 加入收藏
lzx1556
Rank: 1
等 级:新手上路
帖 子:41
专家分:8
注 册:2012-9-5
结帖率:85.71%
收藏
 问题点数:0 回复次数:1 
挑毛病(数组)
Public Sub Conang(Cdz_X() As Single, Cdz_y() As Single, Cdz_h() As Single, ss() As Variant)
       Dim gg As Integer, jj As Integer, m As Integer, n As Integer
       Dim Csdz_X() As Single
       Dim Csdz_y() As Single
       Dim Csdz_h() As Single
       Dim Rs() As Long
       Dim s As Long
       s = 0
       n = 0
       If UBound(ss) = 0 Then Exit Sub
       For gg = 1 To UBound(ss)
       ReDim Preserve Rs(gg)
       Erase Csdz_X()
       Erase Csdz_y()
       Erase Csdz_h()
       If gg = 1 Then
          m = 0
       Else
          m = Rs(gg - 1)
       End If
       For jj = m To ss(gg)
           ReDim Preserve Csdz_X(n)
           ReDim Preserve Csdz_y(n)
           ReDim Preserve Csdz_h(n)
           Csdz_X(n) = Cdz_X(jj)
           Csdz_y(n) = Cdz_y(jj)
           Csdz_h(n) = Cdz_h(jj)
           n = n + 1
       Next
       If gg = 1 Then
          Rs(gg) = ss(gg - 1)
       Else
          Rs(gg) = m + ss(gg) - ss(gg - 1)
       End If
    Comang s, Csdz_X(), Csdz_y(), Csdz_h()'输出
       s = s + 1
        Next gg
End Sub

可以正常运行,但从第二个循环开始有重复的数据,为何?

[ 本帖最后由 lzx1556 于 2014-6-18 20:06 编辑 ]
2014-06-17 22:30
lzx1556
Rank: 1
等 级:新手上路
帖 子:41
专家分:8
注 册:2012-9-5
收藏
得分:0 
回复 楼主 lzx1556
问题已解决,如果您也看出来,我也给分的
2014-06-18 20:09
快速回复:挑毛病(数组)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030031 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved