Hi
I am trying to add 2 variables together but I think the computer see's the numbers as a string instead of an integer.
I have looked for help with this but all I can see is ASP doesn't allow the user to define a variable as an int or a string
My code is very simple (I hope). I retrieve a 4 digit code from my database which I call var_Pin. I then split it to var_LowPin and var_HighPin and I think it is at this point the computer sees the number as a string instead of an integer.
I have added ***** beside the line that is also partly the fault. If I change var_HighPin to a number (eg) 20, it works fine.
<%
dim var_Pin
var_Pin = (rsSampleReques t.Fields.Item(" PinsPerRow").Va lue)
dim var_LowPin
var_LowPin = (Left(var_Pin,2 ))
dim var_HighPin
var_HighPin = (Right(var_Pin, 2))
dim var_CurrentPin
var_CurrentPin = var_LowPin
Do While var_CurrentPin < var_HighPin *****
response.Write( var_CurrentPin)
var_CurrentPin = var_CurrentPin + 1
Loop
%>
Any ideas?
Thank you
Dave
I am trying to add 2 variables together but I think the computer see's the numbers as a string instead of an integer.
I have looked for help with this but all I can see is ASP doesn't allow the user to define a variable as an int or a string
My code is very simple (I hope). I retrieve a 4 digit code from my database which I call var_Pin. I then split it to var_LowPin and var_HighPin and I think it is at this point the computer sees the number as a string instead of an integer.
I have added ***** beside the line that is also partly the fault. If I change var_HighPin to a number (eg) 20, it works fine.
<%
dim var_Pin
var_Pin = (rsSampleReques t.Fields.Item(" PinsPerRow").Va lue)
dim var_LowPin
var_LowPin = (Left(var_Pin,2 ))
dim var_HighPin
var_HighPin = (Right(var_Pin, 2))
dim var_CurrentPin
var_CurrentPin = var_LowPin
Do While var_CurrentPin < var_HighPin *****
response.Write( var_CurrentPin)
var_CurrentPin = var_CurrentPin + 1
Loop
%>
Any ideas?
Thank you
Dave
Comment