If Expression

Why Trust Techopedia

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.

Advertisements

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:

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

Advertisements

Related Terms

Margaret Rouse
Technology Expert
Margaret Rouse
Technology Expert

Margaret é uma premiada redatora e professora conhecida por sua habilidade de explicar assuntos técnicos complexos para um público empresarial não técnico. Nos últimos vinte anos, suas definições de TI foram publicadas pela Que em uma enciclopédia de termos tecnológicos e citadas em artigos do New York Times, Time Magazine, USA Today, ZDNet, PC Magazine e Discovery Magazine. Ela ingressou na Techopedia em 2011. A ideia de Margaret de um dia divertido é ajudar os profissionais de TI e de negócios a aprenderem a falar os idiomas altamente especializados uns dos outros.