Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing values through a loop using a form

Status
Not open for further replies.

fergman

Technical User
Oct 19, 2000
91
US
I'm trying to pass an incrementing value through a loop of forms. But I keep running into a type mismatch, here's the deal.

I have two variables
varLoopNum and classNumber
varLoopNum is a hidden field that contains a 0 to start with, classNumber is just a variable, that is trying to contain the current varLoopNum value literally classNumber = varLoopNum
they have both been initalized as = 0. But I still get a type mismatch. Is there anyway to make them an integer, I do know that vbscript just uses variants, but there has got to be a way to force types.
 
Here is the main sub:

sub main()
classNumber = varLoopNum
classNumber = classNumber + cint(1)
response.write classNumber & "= classNumber" & varLoopNum & " Varloopnum"

if varId <> &quot;&quot; then
response.write &quot;varId = &quot; & varId
id = varId
varDepartment = &quot;&quot;
varCourse = &quot;&quot;
varSection = &quot;&quot;
varRecommended = &quot;&quot;
end if

call getDepartment

if depTrue = 1 then
call getCourse
end if

if couTrue = 1 then
call getSection
end if

if secTrue = 1 then
call getRecommended
end if

if recTrue = 1 then
formState = 1
end if


if formState = 1 AND varRecommended = &quot;yes&quot; OR varRecommended = &quot;no&quot; then
varLoopNum = varLoopNum + cint(1)
call writeDB
%>
<SCRIPT Language=&quot;JavaScript&quot;>
document.form1.submit()
</Script>
<%
end if

end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top