User Tools

Site Tools


nullable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

nullable [2018/07/02 05:54] (current)
wolfgangriedmann created
Line 1: Line 1:
 +====== Nullable Datatypes ======
 +
 +Contrary to VO, many datatypes in the .NET Framework don't allow null values. 
 +
 +One of the most important ones is the DataTime class, that cannot have a null value, contrarily to VO, where a date variable can contain null_date.
 +
 +In the .NET Framework there is the ''Nullable'' datatype, defined as follows:
 +<code>Nullable<T></code>
 +and to be used like this:
 +<code>local dDate as Nullable<DateTime>
 +
 +dDate := null
 +dDate := DateTime.Now</code>
 +
 +Reference types in the .NET Framework don't need ''Nullable'', they already support null values.
 +
 +For more information see [[https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/|docs.microsoft.com/en-us/dotnet/csharp/programming-guide/nullable-types/]]
  
nullable.txt ยท Last modified: 2018/07/02 05:54 by wolfgangriedmann