Solved

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 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

19 Experts available now in Live!

Get 1:1 Help Now