vb.net Boolean und Nichts

Definieren wir diese Funktion :

Public Function Test(ByVal value As Boolean)
    Return "blabla" + If(value = Nothing, "", If(value, "1", "0"))
End Function

Möchte ich Sie Folgendes tun :
Test(True) -> "blabla1"Test(False) -> "blabla0"Test(Nothing) -> "blabla".

Problem ist, dass Test(Nothing) gibt "blabla0".

InformationsquelleAutor der Frage Arthur Rey | 2013-11-12

Schreibe einen Kommentar