Don't miss an insight. Subscribe to Techopedia for free.


If Expression

What Does If Expression Mean?

The if statement is a programming language test that is done to determine whether a condition holds true. If the condition that is being tested holds true, a certain code is executed by the programmer that differs if it holds false. The if statement can be described with the Boolean expression, which produces a true or false value based on evaluation. The if statement is part of this evaluation.


Techopedia Explains If Expression

The if statement is used with an else statement when coding. Code is directed with the else statement depending on whether the if statement holds true.

In the example below, a manager will add a bonus of 5 percent to all employee salaries except those in the advertising department. Those employees will get a bonus of 8 percent added to their salary. The code for this looks like the following:

{Employee.Dept} = "Advertisement" Then
{Employee.Salary} * 0.08
{Employee.Salary} * 0.05


Related Terms