Hello -
I was wondering that the "cleanest" way is to determine whether a
CType() will throw an InvalidCastExce ption? I have data I receive as
an Object and I want to convert it to a String whenever possible using
CType(lObjectDu mmy, String) otherwise I will just ignore it.
I could put a Try/Catch As System.InvalidC astException around it but I
was wondering if that is the best solution. I once heard that
exceptions should not be used as a tool but rather as a means to
intercept problems during run-time.
Thanks,
Joe
I was wondering that the "cleanest" way is to determine whether a
CType() will throw an InvalidCastExce ption? I have data I receive as
an Object and I want to convert it to a String whenever possible using
CType(lObjectDu mmy, String) otherwise I will just ignore it.
I could put a Try/Catch As System.InvalidC astException around it but I
was wondering if that is the best solution. I once heard that
exceptions should not be used as a tool but rather as a means to
intercept problems during run-time.
Thanks,
Joe
Comment