473,666 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can i say OR in an if/then statement

I am trying to say

if (condition) is true OR (condition) is true THEN

Can I use OR or do ihave to break it down into an elseif statement?

I tried OR but it does not seem to work.

thanks. crispy
Jul 19 '05 #1
6 32268

"crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
news:n8******** *************** *********@4ax.c om...
I am trying to say

if (condition) is true OR (condition) is true THEN

if (condition) OR (condition) THEN

or

if (condition) = true OR (condition) = true THEN

but remeber that is a boolean value true or false, it is not the same a
string value "true"

in that case

use
if (condition) = 'true' OR (condition) = 'true' THEN

you may even want to use lcase(condition ) = 'true'

lcase(value) chanes it to lower case

Can I use OR or do ihave to break it down into an elseif statement?

I tried OR but it does not seem to work.

thanks. crispy

Jul 19 '05 #2
Tim
I can only guess that you tried

if x=5 or 10 then

which is incorrect and should be

if x=5 or x=10 then
Tim

"crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
news:n8******** *************** *********@4ax.c om...
I am trying to say

if (condition) is true OR (condition) is true THEN

Can I use OR or do ihave to break it down into an elseif statement?

I tried OR but it does not seem to work.

thanks. crispy

Jul 19 '05 #3
Tim wrote on 09 jul 2003 in microsoft.publi c.inetserver.as p.general:
I can only guess that you tried

if x=5 or 10 then

which is incorrect and should be

if x=5 or x=10 then


And:

if x=5 or not x>3 then

is legal.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4
Crispy,

Here is a good vbscript syntax help page.

http://www.devguru.com/Technologies/...ipt_intro.html

Mike
"crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
news:n8******** *************** *********@4ax.c om...
I am trying to say

if (condition) is true OR (condition) is true THEN

Can I use OR or do ihave to break it down into an elseif statement?

I tried OR but it does not seem to work.

thanks. crispy

Jul 19 '05 #5
I strongly recommend you use brackets to keep track of things.

if (x=1) or (x=2) then
'x is either 1 or 2
end if
You'll end up going insane trying to solve order of operation bugs if you
don't.
"crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
news:n8******** *************** *********@4ax.c om...
I am trying to say

if (condition) is true OR (condition) is true THEN

Can I use OR or do ihave to break it down into an elseif statement?

I tried OR but it does not seem to work.

thanks. crispy

Jul 19 '05 #6
Thank you all for your help.

crispy

"crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
news:n8******** *************** *********@4ax.c om...
I am trying to say

if (condition) is true OR (condition) is true THEN

Can I use OR or do ihave to break it down into an elseif statement?

I tried OR but it does not seem to work.

thanks. crispy

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2528
by: Gert Albertse | last post by:
I retrieve the recordset RS("SelectedMultiDisabilityEvent") form a table. The data type is text. When I run the next code: WHILE NOT RS.EOF Response.Write RS("SelectedMultiDisabilityEvent") & "<br>" RS.MOVENEXT WEND
19
8216
by: GMKS | last post by:
Hello all, I have 13 check boxes on a form. I am trying to check all the check boxes to determine if they are true or false when I close the form. At present only the first IF...Then...Else works and then Exits the Sub. Example:
3
19792
by: sck10 | last post by:
Hello, I am trying to use an If Then statement inside of a repeater control. However, I am getting the following error: Expression expected. Any help would be appreciated. Thanks in advance,
11
1527
by: Jason | last post by:
Hello, I would like to fill more than one lable with info in an IF then statement. I know I can do this. If radPizza.checked = true then lblsubtotal.text = FormatCurrency(mdecPizzatotal) end if
3
3929
by: Amy | last post by:
Hi, I have 6 If Then Else statements I was supposed to write. I did so but I know that they have to be wrong because they all look the same. Could someone take a look at them and point me in the right direction about what I am not doing correctly? 1.. Write an If Then Else statement that displays the string "Pontiac" in the CarMakeLabel control if the CarTextBox control contains the string "Grand Am" (in any case).
34
3014
by: Mike Labosh | last post by:
VS.NET 2003, ASP.NET Project with Option Strict turned ON. (yes, I know this is not the aspnet group. This is a VB syntax thing, not an ASP.NET thing) This actually compiles without the "Then" keyword. What gives?!? If Not Page.IsPostBack End If
0
2614
by: kamii47 | last post by:
I am creating in memory xmldocument.Previously I were validating my file against a dtd file and then by the help of GetElementByID read my needed node. i.e. XmlDocumentType doctype = null; doctype = statementsDocument.CreateDocumentType("queries", null,statementsPath +"\\Validation.dtd", null); statementsDocument.AppendChild(doctype); nodeElem = statementsDocument.CreateElement("queries"); statementsDocument.AppendChild(nodeElem); ...
14
4187
by: lawjake | last post by:
I am having a dispute at work over endifs, and cannot find any treatise on this. So I am hoping that I can get a lot of correspondece confirming my belief. Here it is: I believe the following: (1)If a language has an "endif", then every "if" statement requires an endif, and (2) every "endif" goes with the last "if". For example,
1
1717
by: cryptotech2000 | last post by:
What I am looking to do is create an if then statement for a particular access query, here are the facts Tables used Mainframe Report List Fields Within the table that are used for the if then statement GENERATIONS FREQUENCY EXTENDED
1
1986
by: digidave | last post by:
I am keenly aware that my coding skills are extremely noob but please indulge me a second.. Take a look at these queries.. $sql = "SELECT DISTINCT year FROM _current_floats_config WHERE active = 'yes' ORDER BY year DESC LIMIT 2, 1"; $result = mysql_query($sql); while($fetched = mysql_fetch_array($result)) { $ceiling = $fetched; } $sql = "SELECT * FROM _current_floats WHERE active = 'yes' AND yearID <= $ceiling ORDER BY yearID...
0
8878
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8560
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8644
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6200
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5671
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.