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
select case
RSA Encyption example with large numbers using System.Numerics.BigInteger
bb
ex4
VBA
Me3.1
CAI Visual Basic - Ej Mundial
Algorithm to create first letter of each word mnemonic
Poem of the day from 'Selected Poems of Rumi (Dover Thrift Edition)'
Visual-Basic