-
Exiting an if...then statement in vbscript
I'm trying to use an if...then statement within a for...next loop to check
at the outset whether or not a particular value is 0 or not. If it is 0
(zero), then I want to just exit the if...then statement which will, in theory,
go right to the 'next' part of the for...next loop and increment the counter.
Basically, how do I exit an if...then statement like:
FOR i = 1 TO somenumber
quantity = request.form("quantity")
IF quantity = 0 THEN
'exit the if...then statement
ELSE
'execute some code
END IF
NEXT
-
Re: Exiting an if...then statement in vbscript
Either don't put anything between the IF and THEN, or use:
FOR i = 1 TO somenumber
quantity = request.form("quantity")
IF quantity <> 0 THEN
'execute some code
END IF
NEXT
--
Doug Steele, Microsoft Access MVP
Beer, Wine and Database Programming. What could be better?
Visit "Doug Steele's Beer and Programming Emporium"
http://I.Am/DougSteele/
Eric <ericj@newportinternet.com> wrote in message
news:390df1b3$1@news.devx.com...
>
> I'm trying to use an if...then statement within a for...next loop to check
> at the outset whether or not a particular value is 0 or not. If it is 0
> (zero), then I want to just exit the if...then statement which will, in
theory,
> go right to the 'next' part of the for...next loop and increment the
counter.
>
> Basically, how do I exit an if...then statement like:
>
> FOR i = 1 TO somenumber
> quantity = request.form("quantity")
> IF quantity = 0 THEN
> 'exit the if...then statement
> ELSE
> 'execute some code
> END IF
> NEXT
>
>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks