Click to See Complete Forum and Search --> : integers


lloyd123
May 4th, 2001, 05:27 PM
i am tring to set integers but i am having a problem with it. I am using the lines
dim LP,TP,ZP as integer but when i try to use this it does no work is it because i am referring them to the text inside a textbox. can it be done. please help

coolbiz
May 4th, 2001, 05:47 PM
Actually:
dim LP, TP, ZP as integer statement will only set ZP as integer while LP and TP set to VARIANT.

Not very clear with your question but if you're trying to convert a text from a textbox into an integer, than use CINT() or CLNG() such as below:

Dim LP as Integer
LP = CInt(Text1.Text)

Do note that CINT() will throw an exception if the text inside Text1 textbox cannot be converted to a number.

Better to use IsNumeric() function to check if the text can be converted or not.

-Cool Bizs