devxlogo

Simplify Boolean Variable Updates

Simplify Boolean Variable Updates

Instead of using an If construct to set a Boolean variable, you can assign a Boolean variable to the result of any logical comparison. For example, instead of this code:

 If MyNumber > 32 Then	BooleanVar = TrueElse	BooleanVar = FalseEnd If

Use this code:

 BooleanVar = (MyNumber > 32)

devx-admin

Share the Post: