sanders720
Programmer
Can someone please tell me what I am doing wrong here? I simply want to get the first characters of a string until they become non-numeric and apply the quantity variable Q.
Thanks in advance for the help!
Public Sub IsItNumeric(ByVal ConStr As String)
' Example Data is 12XXX or 12
Dim x As Int16
For x = 1 To ConStr.Length
MsgBox(x)
Try
' IsNumeric(ConStr.Substring(1, x))
Q = Convert.ToInt16(ConStr.Substring(1, x))
MsgBox(Q)
Catch ex As Exception
Q = ConStr.Substring(1, x)
MsgBox(Q)
End Try
Next
End Sub
Thanks in advance for the help!
Public Sub IsItNumeric(ByVal ConStr As String)
' Example Data is 12XXX or 12
Dim x As Int16
For x = 1 To ConStr.Length
MsgBox(x)
Try
' IsNumeric(ConStr.Substring(1, x))
Q = Convert.ToInt16(ConStr.Substring(1, x))
MsgBox(Q)
Catch ex As Exception
Q = ConStr.Substring(1, x)
MsgBox(Q)
End Try
Next
End Sub