08-25-2012, 05:02 PM
Thanks Brandon,
Thanks for your response. While waiting, I tried the following code and it seems to work very well:
I will give try adding the Return line as suggested, and see how well this works.
Thanks for your response. While waiting, I tried the following code and it seems to work very well:
Code:
Dim checksum As Integer = 0
Dim doubleflag As Boolean = (value.Length Mod 2 = 0)
Dim digit As Char
Dim digitvalue As Integer
For Each digit In value
digitvalue = Integer.Parse(digit)
If doubleflag Then
digitvalue *= 2
If digitvalue > 9 Then
digitvalue -= 9
End If
End If
checksum += digitvalue
doubleflag = Not doubleflag
Next
Return (checksum Mod 10 = 0)
End Function
I will give try adding the Return line as suggested, and see how well this works.
//Kismet