Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 13th, 2006, 8:34 AM   #11
forcerr
Newbie
 
Join Date: Mar 2006
Posts: 8
Rep Power: 0 forcerr is on a distinguished road
so

if computer = "computer1" & "computer2" Then

wouldnt work?
forcerr is offline   Reply With Quote
Old Mar 13th, 2006, 8:37 AM   #12
Uday
Programmer
 
Join Date: Oct 2005
Location: India
Posts: 30
Rep Power: 0 Uday is on a distinguished road
Quote:
and if its computer1 or 2 then it will do something
Use or
Uday is offline   Reply With Quote
Old Mar 13th, 2006, 9:12 AM   #13
Uday
Programmer
 
Join Date: Oct 2005
Location: India
Posts: 30
Rep Power: 0 Uday is on a distinguished road
<html>
<head>
</head>
<body>

<script type="text/vbscript">
dim comp
dim names(3)
comp="Jani"
names(0)="tove"
names(1)="Jani"

If comp=names(0) or comp=names(1) then
document.write(comp)
Else
document.write("not found")
end If

</script>

</body>
</html>
Uday is offline   Reply With Quote
Old Mar 13th, 2006, 10:24 AM   #14
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
There's a big difference in the way you choose to express it. Distinguish between ORing (or ANDing) two values and testing the result against a third, and testing the result of whether or not EITHER (or BOTH) of the two values is equal to another.

if (C == A OR B) tests to see if C is equal to A ORed with B.
if ((C == A) OR (C == B)) test to see if C is equal to A or if C is equal to B.

In some languages, JS among them, == and = mean two different things. The precedence of operations in the language will determine the amount of parenthesization that is necessary for correctness.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:33 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC