I have a button visible binding code as:
!((({Root Container.type} = 4) || ({Root Container.type} = 5)) && ({Root Container.bp.command} & 0x0080)) && !(!(({Root Container.type} = 4) || ({Root Container.type} = 5)) && ({Root Container.bp.command} & 0x0040))
The code works correctly but when I open the popup window in designer I get an error message. If I set the single & to && then the error goes away but my logic fails.
What am I doing incorrectly? Any suggetions?
FYI To shorten the code I would like to use ({Root Container.type} = (4 or 5)) but I cannot get that logic to work either.
The issue is indeed that {Root Container.bp.command} is null.
& and && have different meanings. & is a bitwise AND operator. && is a logical AND operator.
Unfortunately, the expression language does have a tendency to become very hard to read if care is not taken. There is also a lot of times where the use of a different expression will simplify the expression as well. On top of that, white space is not a factor so you can space out the expression to make it easier to read and follow.
I have the same popup window for 7 types of motor equipment. I am passing a parameter named type to determine what graphics to display in the popup window. If the (type is 4 or 5) and the command is not 0x0040 or the type is not (4 or 5) and the command is 0x0080 then show this graphic.
if({Root Container.type} = 4 || {Root Container.type} = 5
, !({Root Container.bp.command} = 0x0040) // Type is either 4 or 5
, {Root Container.bp.command} = 0x0080 //Type is not 4 or 5
)
I am going to show my ignorance here but I have never seen ‘,’ after an if statement
I assume that the system reads it as (true/false statement, true comparison, false comparison)
Oh is this in the transform that pascal fragnoud mentioned?