Join int/long Array
03.04.2018 14:12:13
Peter(silie)
ich möchte Join bei einem Long Array verwenden.
Bekomme allerdings folgendes:
Der Code sieht folgend aus:
'checks the id for the correct year value
Private Function Check_Number(ByVal number_ As Long) As Long
Dim num(1 To 9) As Long
Dim year_ As Long
Dim i As Long
'get the current year
year_ = CLng(Format(Date, "yy"))
'put into array
For i = 1 To Len(CStr(number_))
num(i) = CLng(mid(number_, i, 1))
Next i
'if the first two numbers dont hold the current year
'then change to be correct
If CStr(num(1)) & CStr(num(2)) year_ Then
num(1) = CLng(Left(year_, 1))
num(2) = CLng(Left(year_, 2))
End If
Check_Number = CLng(Join(num))
End Function