<-- Previous || Up || Next -->

Null To Value Function
Convert Values Class

Public Function NullToValue( _
      ByVal vValue As Variant _
    , ByVal vReplace As Variant _
    ) As Variant

Replace Null values with some default value.
Leave all other types of values unchanged.

    NullToValue(Null, 0) = 0
    NullToValue(Null, "N/A") = "N/A"
    NullToValue("Word", "N/A") = "Word"
    NullToValue(123456, 12) = 123456
See also:
    NullToBlank Function
    NullValue Property
vValue: The value which is to be returned as-is unless it is Null, in which case vReplace will be returned.
vReplace: The value that will be returned if vValue is Null. Function returns vValue unchanged in all other cases.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.