Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
RSA Encyption example with large numbers using System.Numerics.BigInteger
Rounding behaviours
liaison v2
Exercico 5
Algorithm to create first letter of each word mnemonic
Funksiya yaratish
Selected Poetry of Rumi ~ doy mod 119
Declaração de Variaveis
VB checking whether a date is between 2 dates
ss
Please log in to post a comment.