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 / Problem with OR operator

Author
Message
DynamicLink
11
Years of Service
User Offline
Joined: 26th May 2013
Location:
Posted: 6th Jul 2013 22:35
I had some strange problems(for me) with logical operators in dbpro. Can anyone tell me please why does this code gives an error:


Error: Both operands are required for non-uniary operations at line 198.
Minus and Minus2 are the constants for the - Keystate Number

Also, does anybody know a good tutorial for dbpro complex logical expressions? As far as i have seen, all tutorials present simple examples of AND, OR, etc. usage.

Thanks!
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 7th Jul 2013 12:15
This code works fine for me:



I did notice that the word minus is highlighted as if it is a keyword, if DBP is trying to perform a mathematical operation with that command, the error message would make sense to me.

Perhaps you're also doing something wrong after the if statement?

Quote: "Also, does anybody know a good tutorial for dbpro complex logical expressions? As far as i have seen, all tutorials present simple examples of AND, OR, etc. usage."


There's a lot of scattered information, but no real tutorial. You'll have to search the forums for more information.

There are two types of logical operators, bytewise and bitwise operators.

Bytewise
-AND
-OR
-NOT
-XOR

Bitwise
>> (bitshift right)
<< (bitshift left)
&& (bitwise and)
|| (bitwise or)
~~ (bitwise xor)
.. (bitwise not)

This is from the help files:



TheComet

DynamicLink
11
Years of Service
User Offline
Joined: 26th May 2013
Location:
Posted: 7th Jul 2013 17:20
thanks for your answer

Minus and Minus2 are defined constants for the symbol -. they are 12 and 74(from numpad)

The problem is with Minus2. If i put the value 74 the program works fine, although i have defined both numbers. still working on finding out why.

DynamicLink
11
Years of Service
User Offline
Joined: 26th May 2013
Location:
Posted: 7th Jul 2013 18:03
just solved the problem... it was becuase of the definition of the constant...after
i placed a remark using // like in C++ and Minus2 was defined as 74 /

Login to post a reply

Server time is: 2024-11-23 14:48:06
Your offset time is: 2024-11-23 14:48:06