Val() would work, but would be a little inefficient because it would convert the string txtFirstNum.Text to a double, then the double would be converted to an Integer so that StoreNum could hold it.
That said, it will probably make around one nanosecond of difference. Just don't put it in a big loop!
Also, you may get an overflow error if the number held in txtFirstNum.Text is too big for an integer (8,388,608 max). If you set txtFirstNum.MaxLength to 6 or less, you won't get any problems (being that the highest number you could then put in would be 999,999)
quote:Originally posted by john.fl
Would it be appropriate, instead, to use
Dim StoreNum as Integer
StoreNum = Val(txtFirstNum.Text)
I am new to VB.Net, I recognize Val() as a holdover from VB 6.0 but am uncertain if using it (in this situation) is reliable.