|
Ralph1971 Wanderer
Joined: 01 Mar 2008 Posts: 64
|
Posted: Tue May 17, 2011 4:05 pm
variable comparison |
I'm looking to try to compare variables in 2 ways..
variables.. line1, line2, line3
first comparison..
line1=line2 and line1=line3.. (all three same thing) one thing happens
line1=line2 OR line1=line3 OR line2=line3 (any 2 the same) different thing happens
the three way comparison is throwing me for a loop.. is there an efficient way of doing that? |
|
_________________ Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21 |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue May 17, 2011 7:59 pm |
Sure. There are two obvious ways. The first is to put the second #IF statement within the ELSE portion of the first #IF statement. The second option is to use a #SWITCH command. Since there are only two choices, I would probably do the first option:
Code: |
#IF (line1=line2 AND line1=line3) {
one thing happens
} {
#IF (line1=line2 OR line1=line3 OR line2=line3) {
different thing happens
}
}
|
|
|
|
|
Ralph1971 Wanderer
Joined: 01 Mar 2008 Posts: 64
|
Posted: Tue May 17, 2011 10:01 pm |
Ok, haven't tried that witch cmud yet, but zmud really didn't like the OR's... I'll shoot for cmud and see what happens
|
|
_________________ Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21 |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed May 18, 2011 3:30 am |
AND/OR are standard to both apps. The only difference came in the shortcuts of &/&& and |/||.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
martyall Newbie
Joined: 17 May 2011 Posts: 3
|
Posted: Wed May 18, 2011 4:07 am |
Thanks MattLofton. You really give me ideas. Thanks for your valuable information. :D
|
|
|
|
|
|