Solved

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

Posted on 2003-10-24
2
220 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

829 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