| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 405 人关注过本帖
标题:[求助]下标越界
只看楼主 加入收藏
四环素牙
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2006-11-19
收藏
 问题点数:0 回复次数:1 
[求助]下标越界
Function Rect(a() As Double, l As Long) As Double
Dim T0 As Double
Dim T1 As Double
Dim T2 As Double
Dim T3 As Double
Dim Rect6_T As Double
Dim B() As Double
Dim Sum As Double
Dim Cha As Long
Cha = 0
ReDim B(l - 1, l - 1)
Sum = 0
If l = 1 Then
Rect = a(0, 0) * a(1, 1) - a(0, 1) * a(1, 0)
Exit Function
End If
For T0 = 0 To l
For T1 = 1 To l
For T2 = 0 To l - 1
If T2 = T0 Then Cha = 1
B(T1 - 1, T2) = a(T1, T2 + Cha)
Next T2
Cha = 0
Next T1
Sum = Sum + a(0, T0) * Rect(B(), l - 1) * (-1) ^ T0
Next T0
Rect = Sum
End Function

运行的时候在红字的地方提示下标越界,谁能帮改一下?
搜索更多相关主题的帖子: 越界 
2006-11-29 14:39
sansizhou
Rank: 1
等 级:新手上路
帖 子:47
专家分:0
注 册:2006-11-24
收藏
得分:0 
定义的时候是一维的,后面是2维的。将Dim B() As Double改为Dim B(2,2) As Double看看
2006-11-29 15:16
快速回复:[求助]下标越界
数据加载中...
 
   



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

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