Public Sub Main()
Dim sTrial As String[] = ["49927398716", "49927398717", "1234567812345678", "1234567812345670"]
Dim sRev As String
Dim siCount, siOdd, siEven, siHold, siQty As Short

For siQty = 0 To sTrial.Max

  siOdd = 0
  siEven = 0
  sRev = ""

  For siCount = Len(sTrial[siQty]) DownTo 1
    sRev &= Mid(sTrial[siQty], siCount, 1)
  Next

  For siCount = 1 To Len(sRev)
    If Odd(siCount) Then siOdd += Val(Mid(sRev, siCount, 1))
    If Even(siCount) Then
      siHold = Val(Mid(sRev, siCount, 1)) * 2
      If siHold > 9 Then
        siEven += Val(Mid(Str(siHold), 1, 1)) + Val(Mid(Str(siHold), 2, 1))
      Else
        siEven += Val(Mid(sRev, siCount, 1)) * 2
      End If
    End If
  Next

  sRev = Str(siOdd + siEven)
  If sRev Ends "0" Then
    Print sTrial[siQty] & " is a valid number"
  Else
    Print sTrial[siQty] & " is NOT a valid number"
  End If
Next

End
