By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,433 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

If ... NOT "" Then .... question

P: n/a
Got a bit of code, which I want to loop through, unless the current value is
"", in which case I need ti to skip to the next one, but how do I do it?

Response.Write "<br />" & vbCrLf
For Each strItem In Request.Form
If strItem = "" THEN
'these next two lines, I only want to be processed if the above does
have a value in it.
Response.Write "-" & strItem & "-" & vbCrLf
Response.Write "-" & Request.Form(strItem) & "<br />" & vbCrLf
End If
Next
Response.Write "<br />" & vbCrLf
Regards
David
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
David Aldred wrote:
Got a bit of code, which I want to loop through, unless the current
value is "", in which case I need ti to skip to the next one, but how
do I do it?

Response.Write "<br />" & vbCrLf
For Each strItem In Request.Form
strItem, being the key to the Form variables collection, will NEVER be
blank. I suspect you actually want to test the content of the Form
variables, rather than the variable names. To do that, you would do this:

For each key in request.form
strItem = Request.Form(key)
If strItem = "" THEN


Bob Barrows
--
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.
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.