Wednesday 15 November 2017

Lazy IF statement for Variable Assignment

Five-line code

If &Color = "Blue" And &Pet = "Dog" Then
  &Flag = True;
Else
  &Flag = False;
End-If;

can be converted to one line

&Flag = (&Color = "Blue" And &Pet = "Dog");

&Flag is TRUE if both conditions are true.

False otherwise.