G
Guest
Hello. I have an exception performance issue. What I am doing is trying to
cast a substring into an integer with CINT(string.substring(x,y)). And if it
doesn't work, I am catching the exception and then entering the substring
into a string variable. Here is my code.
Try
record9row.Item(y) = CInt(lineOfText.Substring(x, record9Sizes(y)))
Catch ex As Exception
record9row.Item(y) = lineOfText.Substring(x, record9Sizes(y))
End Try
The problem is I am looping through this over 500,000 times (populating a
database) and it takes a long time. Is there an alternative to exceptions
that could be used to check if the value in the substring can be cast into an
integer value? This is just taking too long.
Thanks in advance.
Matt
cast a substring into an integer with CINT(string.substring(x,y)). And if it
doesn't work, I am catching the exception and then entering the substring
into a string variable. Here is my code.
Try
record9row.Item(y) = CInt(lineOfText.Substring(x, record9Sizes(y)))
Catch ex As Exception
record9row.Item(y) = lineOfText.Substring(x, record9Sizes(y))
End Try
The problem is I am looping through this over 500,000 times (populating a
database) and it takes a long time. Is there an alternative to exceptions
that could be used to check if the value in the substring can be cast into an
integer value? This is just taking too long.
Thanks in advance.
Matt