Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently November 7th, 2024, 12:38 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Using Boolean "OR" with variables
PostPosted: August 8th, 2007, 1:22 am 
I've done this before, but today my mind is a complete blank. Must be another of those annoying senior moments :oops:

What I want to do is simple -- it has to be or I would never have managed to do it before.

Incidentally, I'm talking about the mathematical Boolean relationships, NOT the Boolean relationships used in OpusScript.


I have 2 variables, let's call them variable1 and variable2.

Basically, I want to monitor these variables:

If variable1 = 1
OR
If variable2 = 2

a certain action occurs.

There is no ELSE component to this.

When I set up the IF statements,

IF variable1 = 1
IF variable2 = 2

they act in a Boolean AND relationship, whereas what I want is a Boolean OR relationship.

Can someone please kick-start my brain into action?


Top
   
 
 Post subject:
PostPosted: August 8th, 2007, 3:09 am 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Hi Ray,
if I understand you correctly.

In script it's something like::

if ((variable1==1) || (variable2==2))
{
do something here
}

cheers
Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 8th, 2007, 3:23 am 
That's it! Thanks Paul.

It was simple. I had used "|" instead of "||"

Like they say, simple things trip simple minds.


Top
   
 
 Post subject:
PostPosted: August 8th, 2007, 8:15 am 
Offline

Joined: October 25th, 2004, 3:03 pm
Posts: 540
Location: Tyalgum Creek. Australia
Opus: Opus Pro Latest version 9.02 Build 16458
OS: Won 10
System: Asus laptop Intel Core i5 8 gig ram, big monitor, reading glasses
Don't be fooled folks!

Sentosa's brilliant mind is far from simple and ancient as he frequently portrays!! :lol:

It is exceedingly intelligent, ingeniously complex, rich and eloquent.

Cheers

Graham

_________________
Too much coffee can result in frequent toilet breaks!


For this message Graham Baglin has been thanked by : mackavi


Last edited by Graham Baglin on August 8th, 2007, 8:19 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: August 8th, 2007, 8:17 am 
Careful. You'll have me blushing :oops:


Top
   
 
 Post subject: Select & Case
PostPosted: August 8th, 2007, 12:22 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
Ray --

Have you thought about using "SELECT & CASE" instead of "IF"? In the future, if you add additional options, it would be much easier if you were using SELECT & CASE. You just create a Variable, put it into a SELECT Action, then add as many CASE Actions as you need, each one is then directed to do something different. The Default Action covers anything NOT covered by a CASE Action.


You do not have the required permissions to view the files attached to this post.

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


For this message demofred has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Re: Select & Case
PostPosted: August 8th, 2007, 12:31 pm 
demofred wrote:
Ray --

Have you thought about using "SELECT & CASE" instead of "IF"?


No Fred, I haven't. That's an excellent idea! I tend to forget (or perhaps just by-pass) SELECT & CASE. I actually skimmed over it today when wracking my brains.

I'll go back and see if I can make use of it.

BTW -- after Graham's embarrassing comments, I mocked up one pub page with complicated logic and sent it off so that he can see how good I am at digging deep, steep-sided holes for myself. :D

Thanks again. I'll see how I go.


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group