473,327 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Question about For-Next

Hello,

I have a simple 'For Next'-code (see at the bottom).

In the middle of the loop I want an IF-statement, which (if it is true)
jump over to next level.

I thought I could solve it through simple just writing an IF-statement
and put Next in the middle, but an error message appears.

Do you know how I can solve it?

<%
For m = 0 To Ubound(minArray,2)

If Isnull(minArray(0,m)) or minArray(0,m) = "" Then
Next
End If

Response.Write "Hello world!"

Next
%>

Thank you!

Kristoffer

Jan 30 '06 #1
2 1035
kr*****************@gmail.com wrote:
Hello,

I have a simple 'For Next'-code (see at the bottom).

In the middle of the loop I want an IF-statement, which (if it is
true) jump over to next level.

I thought I could solve it through simple just writing an IF-statement
and put Next in the middle, but an error message appears.

Do you know how I can solve it?

<%
For m = 0 To Ubound(minArray,2)

If Isnull(minArray(0,m)) or minArray(0,m) = "" Then
Next
End If

Response.Write "Hello world!"

Next
%>

For the scenario you are describing, you don't need anything special, just
use your If statement, but in reverse:

<%
For m = 0 To Ubound(minArray,2)

If len(minArray(0,m)) >0 Then
Response.Write "Hello world!"
End If
Next
%>
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 30 '06 #2
<kr*****************@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
: Hello,
:
: I have a simple 'For Next'-code (see at the bottom).
:
: In the middle of the loop I want an IF-statement, which (if it is true)
: jump over to next level.
:
: I thought I could solve it through simple just writing an IF-statement
: and put Next in the middle, but an error message appears.
:
: Do you know how I can solve it?
:
: <%
: For m = 0 To Ubound(minArray,2)
:
: If Isnull(minArray(0,m)) or minArray(0,m) = "" Then
: Next
: End If
:
: Response.Write "Hello world!"
:
: Next
: %>

<%
For m = 0 To Ubound(minArray,2)
if minArray(0,m) <> "" then Response.Write "Hello world!"
next
%>

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jan 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tony Johansson | last post by:
Hello! I'm reading a book about C++ and there is something that I don't understand so I ask you. I have marked the section from the book that is of intertest by tagging it with BOOK START HERE...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
21
by: John Welch | last post by:
Sometimes I post a question here and someone answers it quickly with an answer like "well, I don't know much about this, but maybe such and such." While I completely appreciate their effort, I...
73
by: JoeC | last post by:
I am writing a game and I am having a challenge with my combat function. All I want to do is find out how to group pieces that are in the same space. There are two sides and all the units that...
1
by: chiefs | last post by:
I'm tyring to get the output of the Question # with last question at the end. Here is the code: Instead of printing the # after the Question, it prints the ASCII Characters. /* print question#...
15
by: Gary Peek | last post by:
Can anyone tell us the browsers/versions that exhibit errors when tables are nested too deeply? And how many levels of nesting produces errors? (not a tables vs CSS question)
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
16
by: Heinrich Pumpernickel | last post by:
i got the following strange extra question in a written test today . since the test was abt c/c++ i guess this is on topic here --8<-- 22) Consider the following quote: "If Mickey's a...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
56
by: mdh | last post by:
As I begin to write more little programs without the help of the exercises, little things pop up that I need to understand more fully. Thus, below, and although this is not the exact code, the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.