Solved

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

776 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