Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
If Function returns not Nothing for DateTime
'Rextester.Program.Main is the entry point for your code. Don't change it. 'Compiler version 11.0.50709.17929 for Microsoft (R) .NET Framework 4.5 Imports System Imports System.Collections.Generic Imports System.Linq Imports System.Text.RegularExpressions Namespace Rextester Public Module Program Public Sub Main(args() As string) For Each b as Boolean in {True, False} ' "If" function should return Nothing, if 'b' is True. ' But surprise, surprise: it returns DateTime.MinValue... ' Shame on you, VB! This must be a bug, because in C# this works as expected. dim d = If(b, Nothing, DateTime.Today) Console.WriteLine("Parameter b: " & b) Console.WriteLine("Result is Nothing: " & (d Is Nothing).ToString() & " '" & d.ToString() & "'") Console.WriteLine() Next End Sub End Module End Namespace
run
|
edit
|
history
|
help
0
valor maximo entre 3 numeros
Black Jack
Selected Poetry of Rumi ~ doy mod 119
String
Exercício de variáveis 1
ex4
jjj
Hello
rotina de professores (select case)
Selected Shakespeare Sonnet for doy mod 150