When to use || vs OR in ColdFusion in <cfif>?

When I use "OR" against a || in cfif statement ColdFusion?

+3
source share
5 answers

Double tube (as well as double ampersand) are supported in ColdFusion with CF8. Since I found out that I always use double pipe / double ampersand instead of OR / AND. The reason I'm coding this style is because "OR" is not completely descriptive about the operation being performed. There is a bitwise OR, logical-OR, and logical-OR with a short circuit.

Bitwise OR: 01 | 10 = 11

Logical OR: buildErrorsOn(form.varA) | buildErrorsOn(form.varB)

Logical OR (short circuit): isDefined('url.doStuff') || isDefined('url.doStuff')

, (Oracle, , ), double pipe Logical-OR . .

+6

|| CFSCRIPT OR CFML.

+3

CF9 , , . , , OR CFIF || SQL-.

+2

|| CF8. CF8

"" . ( "+" SQL - SQL Server?)

+2

Not sure about this, but it seems that the operator cfifonly supports OR, so the answer to your question is "always." See this:

0
source

Source: https://habr.com/ru/post/1732195/


All Articles