Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I combine two combined conditions in a Conditional statement using vbscript in ASP

Posted on 2003-10-24
2
Medium Priority
?
226 Views
Last Modified: 2012-05-04
Here is my problem...

I would like to create a conditional statement along the following pseudocode....

if these two conditions are true OR the following three conditions are true then do the following...I have grouped the conditions that belong together.  Normally I would write these as two different conditions...but I am looking for a way to shorten it as the code that occurs after the conditions are met is very long (it is a form).

<%if QSpro = "ed" and  Request.querystring("action") = ""  or QSpro = "ed" and  Request.querystring("action") <> "" and flag="error" then%>
FORM located HERE
end if%>
thanks for your help!
Groovymonkey

thanks
0
Comment
Question by:groovymonkey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 19

Expert Comment

by:Dexstar
ID: 9615884
groovymonkey,
> if these two conditions are true OR the following three conditions are true
> then do the following...I have grouped the conditions that belong together.  
> Normally I would write these as two different conditions...but I am looking
> for a way to shorten it as the code that occurs after the conditions are met
> is very long (it is a form).

I added the proper parenthesis and formatted it for readability.
Try this:
     
<% if (
          ((QSpro = "ed") and (Request.querystring("action") = ""))
          or
          ((QSpro = "ed") and (Request.querystring("action") <> "") and (flag="error"))
      ) then %>
FORM located HERE
<%end if%>

Hope that helps,
Dex*
0
 
LVL 19

Accepted Solution

by:
Dexstar earned 1000 total points
ID: 9615935
groovymonkey,

After looking at it more closely, I believe you can use this much more simple statement:
         
     <% if ( (QSpro = "ed") AND ((Request.querystring("action") = "") OR (flag="error")) ) then %>
     FORM located HERE
     <%end if%>

Hope that helps,
Dex*
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question