英语翻译Private Function iDYTS(yue1 As Integer) As IntegerIf yue1 12 TheniDYTS = CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/1")ElseiDYTS = 31End IfEnd Function主要是 CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/01 07:32:27
英语翻译Private Function iDYTS(yue1 As Integer) As IntegerIf yue1 12 TheniDYTS = CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/1")ElseiDYTS = 31End IfEnd Function主要是 CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/
英语翻译
Private Function iDYTS(yue1 As Integer) As Integer
If yue1 12 Then
iDYTS = CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/1")
Else
iDYTS = 31
End If
End Function
主要是 CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/1") 这句怎么理解?
英语翻译Private Function iDYTS(yue1 As Integer) As IntegerIf yue1 12 TheniDYTS = CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/1")ElseiDYTS = 31End IfEnd Function主要是 CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/
Private Function iDYTS(yue1 As Integer) As Integer '函数定义,参数为月份数,整型
If yue1 12 Then '如果月份不等12
iDYTS = CDate("1999/" & yue1 + 1 & "/1") - CDate("1999/" & yue1 & "/1") '月天数的计算,就是根据这个月份数先算出下一个月的第一天CDate("1999/" & yue1 + 1 & "/1")
'再减去这个月的第一天,CDate("1999/" & yue1 & "/1"),两个日期之差就是天数
Else '否则就为31天
iDYTS = 31
End If
End Function '函数据结束
这是算1999年任意月份天数的函数