Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / 'and' and 'or' commands

Author
Message
Jerry
19
Years of Service
User Offline
Joined: 10th Jan 2005
Location:
Posted: 11th Jan 2005 13:32
I never saw \'and\' or \'or\' commands used in DBC. Does this mean DBC doesn\'t support the use of \'and\' and \'or\' statements in conjunction with \'if\'s? Please tell me that DBC supports these commands; having programed in other languges before, I find it hard for any kind of script to exist without these. However, in case the worst is revealed to me, is there a way to emulate the \'and\' and \'or\' commands (without making a second copy of the code)?
VietDao
20
Years of Service
User Offline
Joined: 30th Oct 2004
Location: Earth, Lovely Earth
Posted: 11th Jan 2005 20:46
Hi,
It does have "If" statement and "and" and "or" statement.
Why don't you try typing some lines of codes like:

to test if there is "and" and "or" commands?
Viet Dao,
Jerry
19
Years of Service
User Offline
Joined: 10th Jan 2005
Location:
Posted: 12th Jan 2005 03:11
Well, i'll admit i haven't tried 'and' yet, but i've tried to several times to see if DBC had an 'or' command but failed to find one. So I took the long route around and reproduced the code.
Since your example didn't include 'or' statements either, I guess that means you don't know it either, or DBC doesn't include them. I'm hoping its the former, but I'm pretty sure now, that its the latter.
I'll give your code a try thou .
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 17th Jan 2005 01:38
Most languages have the 'And' and 'Or' operators as both logic operators and numerical operators, although DBC only has them as logic operators.

e.g.,

x=1
p=2
If x=1 And p=2
print "Works."
Endif

x=3
p=0
If x=3 Or p=17668
print "Works."
Endif

(Note: The 17668 is a random number put there to prove that it really is just a random number.)

Avatar - white cat in a snowstorm. Look closely.

Login to post a reply

Server time is: 2024-11-27 19:37:51
Your offset time is: 2024-11-27 19:37:51