Solved

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

Posted on 2003-10-24
2
218 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
  • 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now