VB程序设计强化复习主题讲座3.pptVIP

  • 1
  • 0
  • 约8.25千字
  • 约 28页
  • 2019-07-20 发布于湖北
  • 举报
函数过程和Sub过程常用算法总结 function函数过程 Sub过程 参数传递规则(值传递、地址传递) 数组名作为函数参数 数组元素作为函数参数 变量的作用域 变量的生存期 主题一:函数过程 格式 [Public | Private] [Static] Function 函数名(形参列表) As 数据类型 语句块 函数名=表达式 [Exit Function] [语句块] End Function 调用 函数名(实参列表) 也可以用 : Call 函数名( 实参列表 ) 调用 , 这样调用将得不到返回值. Public Sub Combination() Dim m As Integer Dim n As Integer Dim Cmn As Long ……. ‘输入 m, n ****** 错误1 ****** Cmn = nFactor(m) / nFactor(n) * nFactor(m - n) Form1.Print 排列组合数为; Cmn End Sub Public Function nFactor(ByVal n As Integer) As Double Dim i As Integer, temp As Double

文档评论(0)

1亿VIP精品文档

相关文档