* =?Utf-8?B?Sm9l?= said:
private x as integer
property X() as integer
get
return x
set(...)
end property
i don't want to get a value of 0, i want to get nothing, how can do that ar
VB.NET initializes all variables to 'Nothing'. For reference types,
that means, that they contain a reference pointing to 'Nothing'. You
can check if they are pointing to something using 'If foo Is Nothing'.
'Is' compares references. On the other hand, for value types like
'Integer', and all other structures, VB automatically assigns the
default valuue, so in other words, variables are initialized. You can
assign the default value to a variable of a value type by assinging
'Nothing' too. You can check if a value has been assigned by comparing
its value to 'Nothing' using the '=' operator. Notice that this will be
true if you explicitly assigned a value to the variable that is the
default value. For example, if you assign 0 to an 'Integer' variable,
comparing it to 'Nothing' will return 'True'.