| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 401 人关注过本帖
标题:求此表达式的讲解!
取消只看楼主 加入收藏
kowen
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-12-29
收藏
 问题点数:0 回复次数:0 
求此表达式的讲解!
表达式如下:

Private Sub Form_Click()
Dim a(10) As Integer
a(1) = 10: a(2) = 15: a(3) = 5: a(4) = 13: a(5) = 20:
a(6) = 31: a(7) = 25: a(8) = 23: a(9) = 1: a(10) = 17

Text1.Text = sum(True, a)
Text2.Text = sum(False, a())
End Sub
Private Function sum(operate As Boolean, a() As Integer) As Long
Dim i As Integer
If operate Then

For i = LBound(a) To UBound(a)
sum = sum + a(i)
Next
Else
sum = 1
For i = LBound(a) To UBound(a)
sum = sum * a(i)
Next
End If
End Function


1.请帮我讲解一下Text1.Text = sum(True, a) 与 Text2.Text = sum(False, a()) 这两句代码中 (True, a) 与(False, a()) 的区别.
2.小弟不才,刚刚才学,For i = LBound(a) To UBound(a)这句也没有搞懂,还请哪位仁兄讲解,多谢!


搜索更多相关主题的帖子: 讲解 表达 
2006-12-29 16:04
快速回复:求此表达式的讲解!
数据加载中...
 
   



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

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