User Tools

Site Tools


default

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.

local oList as List<string>
  default oList to List<string>{}

This code gives a compile error (as expected):

local oList as List<string>
  default oList to ""
default.txt · Last modified: 2018/05/09 11:28 by wolfgangriedmann