Is Not Null

  

is there anyway to make a condition true by using not equal to (!=) ?

Solution

!= is not a valid operator in OutSystems, but you can use <> instead of !=

Solution

Fábio Fantato wrote:

!= is not a valid operator in OutSystems, but you can use <> instead of !=


what does <> do? I can't find any docs on it. 

Michael Henderson wrote:

Fábio Fantato wrote:

!= is not a valid operator in OutSystems, but you can use <> instead of !=


what does <> do? I can't find any docs on it. 

It means "different" just like !=. It depends on the language and in OS it is <> that we use.


You can also use the prefix "not" or, because this is an if, just switch the branches.


Michael Henderson wrote:

how can I get this function working? 


If(VarAudit.ResponseSentToPrintess != "", True, False)


Have you read my post above?

If(VarAudit.ResponseSentToPrintess <> "", True, False)
If(VarAudit.ResponseSentToPrintess = "", False, True)

If(not VarAudit.ResponseSentToPrintess = "", True, False)

VarAudit.ResponseSentToPrintess <> ""

Hi Michael,

Like Fábio already said, the "not equal" operator is "<>" in OutSystems (that is, a "<" followed by a ">"). This may seem strange for someone only knowing curly braces languages like C, C++, C#, Java or JavaScript, but it has a long history, and languages like Pascal and SQL also use "<>". Note that OutSystems uses other operators also taken from Pascal/SQL, like "and" and "or" instead of "&&" and "||", "not" instead of "!" etc.

As for Nuno's reply, never ever use If(condition, True, False). It's ugly and superfluous. Just use condition by itself (as in Nuno's last example).