Android Question null to zero vb equivalnet nz

Troberg

Well-Known Member
Licensed User
Longtime User
I didn't even know VB had that, after working with it since 3.0 was released. I've used my own NullToZero and NullToEmptyString instead...

As soon as you work with databases, chances are that nulls will occur.

So, some null handling is quite useful to have.
 
Upvote 0

Troberg

Well-Known Member
Licensed User
Longtime User
It's not that hard to make your own:

B4X:
Sub NullToZero(Value as float) as float
  If Value = null Then
    Return 0
  Else
    Return Value
  End If
End Sub

...or something along those lines (can't syntax check it now).
 
Upvote 0
Top