Having a function like isEmpty() to figure out if a value is empty and to over - Mendix Forum

Having a function like isEmpty() to figure out if a value is empty and to over

15

For defensive coding it would be helpful to have a function like isEmpty([checkValue], [vlaueIfEmpty]) like in some other languages, to implement a quick if empty check.

asked
3 answers

completely agree with this. Essential when working with calculations. Right now if I want to add two numbers, for example, there are a lot of hoops to jump over

(if $Value1 != empty then $Value1 else 0.0)+(if $Value2 != empty then $Value2 else 0.0)

This could be simpler

isEmpty($Value1, 0.0) + isEmpty($Value2, 0.0)

 

Created

I don’t know this function in detail, but based on the name I would think yes.

Created

In other words, incorporate the CommunityCommon’s Rule ‘IsEmpty’ a standard Mendix function.

Created