how do i make a string variable into an integer variable.

something like:

number = String

i've always only converted it from a textbox now i'm having trouble using variables.. not sure why it's different..

monthtxt = Mid(CardLength, 1, countnum)
                    yeartxt = Mid(CardLength, i + 1, Yearstart)



                    isvalid = Integer.TryParse(monthtxt.text, numberstyles.currency, _
                        numberformatinfo.CurrentInfo, Month)

basically i want monthtxt to become the integer form in Month.

i think this would be the only important part..

dim intX as integer
intX = Cint("strTEXTE")

>>>casting functiond CDbl, CLng etc

First thing I would observe is that maybe you should use a Byte since there are only 12 month. Otherwise, use the convert functions (cInt() or cByte()) to convert to the number. I. e., after your Monthtxt statement, add intMonth=cInt(monthtext). You will, of course, want to declare intMonth as an integer (although I do suggest using bytMonth and the cByte() function).

how do i make a string variable into an integer variable.

something like:

number = String

i've always only converted it from a textbox now i'm having trouble using variables.. not sure why it's different..

monthtxt = Mid(CardLength, 1, countnum)
                    yeartxt = Mid(CardLength, i + 1, Yearstart)



                    isvalid = Integer.TryParse(monthtxt.text, numberstyles.currency, _
                        numberformatinfo.CurrentInfo, Month)

basically i want monthtxt to become the integer form in Month.

i think this would be the only important part..

This article has been dead for over six months. Start a new discussion instead.