Vb.net DateTime变量集在Visual Basic中等于自身

Vb.net DateTime变量集在Visual Basic中等于自身,vb.net,Vb.net,有没有人会像下面的代码中的dtLocDate一样,在Visual Basic中将DateTime变量设置为自身的原因 Function ShouldBillingStart(ByVal sTheBillingType As String, _ ByRef bStartIt As Boolean, _ ByVal dtBillPeriod As DateTime) As Boolean Dim bLocResult As Boolean Dim dtFirstOfMont

有没有人会像下面的代码中的dtLocDate一样,在Visual Basic中将DateTime变量设置为自身的原因

Function ShouldBillingStart(ByVal sTheBillingType As String, _
  ByRef bStartIt As Boolean, _
  ByVal dtBillPeriod As DateTime) As Boolean

    Dim bLocResult As Boolean
    Dim dtFirstOfMonth As DateTime
    Dim dtLocDate As DateTime

    bLocResult = True
    bStartIt = True
    If bLocResult = True Then
        If CInt(sTheBillingType) = gTheMasterPriceList.PricingType.PRICING_TYPE_DISCOUNTED Then
            dtLocDate = dtLocDate
            dtFirstOfMonth = CDate(Year(dtLocDate) & "/" & Month(dtLocDate) & "/1")
            'add a month
            dtFirstOfMonth = DateAdd(DateInterval.Month, 1, dtFirstOfMonth)
            If Now < dtFirstOfMonth Then
                bStartIt = False
            End If
        End If
    End If

    ShouldBillingStart = bLocResult
End Function
函数ShouldBillingStart(通过val将BillingType设置为字符串_
ByRef bStartIt作为布尔值_
ByVal dtBillPeriod作为日期时间)作为布尔值
Dim bLocResult为布尔值
Dim dtFirstOfMonth作为日期时间
Dim dtLocDate作为日期时间
bLocResult=True
b开始=真
如果bLocResult=True,则
如果CInt(sTheBillingType)=gTheMasterPriceList.PricingType.PRICING\u TYPE\u折扣,则
dtLocDate=dtLocDate
dtFirstOfMonth=CDate(年(dtLocDate)&“/”月(dtLocDate)&“/1”)
“再加上一个月
dtFirstOfMonth=DateAdd(DateInterval.Month,1,dtFirstOfMonth)
如果现在
简而言之,不是。这只是引用自身。Dim语句实例化日期对象。自引用它不会创建对象,也不会设置默认值


这似乎毫无用处。

是的,没有任何理由。例如:

Dim This as String

This = "that"
This = This

浪费时间和资源…

可能是代码最初将其设置为某个值,而不是删除该行,他们这样做是为了记住该行的位置,以防需要将其设置回原位。或者,它可以是用于设置断点的“不做任何事情”行。它什么都不做,不管怎样这里的
DateTime
是什么?通过inter-clop使用的某个.Net类?