User Tools

Site Tools


default

Differences

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

Link to this comparison view

default [2018/05/09 11:28] (current)
wolfgangriedmann created
Line 1: Line 1:
 +====== Default ======
 +
 +VO has a ''​Default''​ statement. This is not typed and checks only if the passed value has a value of ''​NIL''​.
 +
 +The ''​Default''​ statement in X# is strongly typed. This means that the compiler checks if the assigned value is of the correct type for the variable. There is another difference: since the .NET Framework does not knows about the Xbase datatype ''​NIL'',​ it checks if the variable is ''​NULL''​.
 +
 +<​code>​local oList as List<​string>​
 +  default oList to List<​string>​{}</​code>​
 +  ​
 +This code gives a compile error (as expected):
 +
 +<​code>​local oList as List<​string>​
 +  default oList to ""</​code>​
 +
 +
  
default.txt ยท Last modified: 2018/05/09 11:28 by wolfgangriedmann