Skip to main content

IF (condition) THEN (result :=  )

  • If (condition): user can use any normal operators or formulas which can be inserted in (condition). When the condition is true, it will give the result.

Condition can be isolated in parentheses (  ) to organize better (not necessary but good practice)

If ([property]<0)

If ('[property]' = 'Text')

If ([property]=10)

  • Then (result:=): this is the result of the if statement when the above condition is true. User can use any normal operators or formulas here.

The returned value for the result will need to share the same type, being either a text or number, with the "inherited-from" property.

  • Then (result:=[property])
  • Then (result:='[property]') (when the property type is a text)
  • Then (result:=[property]-10) (when the property type is a number)

Example 1: if a equals 10 then d will be 100

PlanSwift Basic IF-THEN formula example 1

Example 2: if a equals 10 then d will display "It is correct"

PlanSwift Basic IF-THEN formula example 2

Example 3: if a is text then d will displays "It is correct"

PlanSwift Basic IF-THEN formula example 3

click here to view the previous article Pascal Expression Available Operators List Basic IF - THEN Statement with More than One Condition click here to view the next article

Related Articles

Be the first to reply!