If (1)=(2)

Interestingly the following code passes the syntax check and works correctly:

If (1)=(2)
ALERT(“1=2”)
Else
ALERT(“1#2”)
End if

From the 4D language specification, the if-then-else statement is:

If (condition)
Else
End If

So either 1)=2( is a valid boolean expression (which it definitely is not) or the condition can be used without the round brackets, if the condition itself has a bracket to the left and to the right. This would be a flaw in the compiler though. Or am I missing something?

It seems that the compiler only checks for the existence of an opening and a closing bracket, because the following also works:

If (cos(pi))=sin(Pi)
End if

I don’t think it to be an issue, but maybe you want to check it.

Michael