integer value in the form "&H9" instead of 9

roshanstevv

Member
Joined
Feb 8, 2007
Messages
12
Programming Experience
1-3
hi all,

I declared an integer variable " Eg:dim age as integer"

and assigned an integer value to the variable "age" declared by the value we entered in a textbox "Eg: age=me.textbox1.text"


now iam passing this age to a method " Eg : AddAge( age1,age2) "



in the method iam doing the following operation

" Eg public sub AddAge( a1 as int32,a2 as int32)

dim TotalAges as integer=nothing
TotalAges= a1+a2

end Sub

My problem is while debugging when i keep the cursor above a1 the value shown there is something like "&H9" if the value is 9 etc..."

but the program is working correctly..

but why it is showing "&H9" instead of 9 ?

plz help..
 
This looks lik it may be a problem with type conversions
in the line age=me.textbox1.text" you are converting a string to an int without converting. Try using age=ctype(me.textbox1.text, integer).

I would suggest you use option strict for your code, it may cause problems in the short term but in the long term it will make your code much more robust.

If it is not erroring, then why are you worrying?
 
Back
Top