Jump to content

for loop


raviprakashg

Recommended Posts

dear friendsi have to use an for loop twise or thrice(it delecared dynamic), Like goto Statement in VB6 it is possible to do in ASP VBScript if not how to Solve itthis code will explain u more

for jcnt= 0 to ubound(arShift,2)       if NewShift  = arshift(0,jcnt) then           CheckShift =1       end ifnextif checkShift = 0 then    NewShift = NewShift+1    if NewShift > arshift(0,Ubound(arShift,2)) then NewShift = arshift(0,Lbound(arshift))'goto  (Here i want to call the for loop again) end if

thanks

Link to comment
Share on other sites

I dont think there is a GOTO in VBScript, One way I can think of is to write theloop in a function and call it in the IF condition....Sub Looping()for jcnt= 0 to ubound(arShift,2) if NewShift = arshift(0,jcnt) then CheckShift =1 end ifnextEnd Subif checkShift = 0 then NewShift = NewShift+1 if NewShift > arshift(0,Ubound(arShift,2)) then NewShift = arshift(0,Lbound(arshift))Looping()end if

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...