ok i would just like to know why. optional parameters cannot have structure types?
Printable View
ok i would just like to know why. optional parameters cannot have structure types?
Optional parameters actually can have structure types, but only if that structure has a corresponding native data type, e.g. Int32 and Integer. The reason is that the default value for optional parameters must be either a constant or Nothing, but Nothing is only really nothing for reference types. For value types, Nothing is an instance with default values, which doesn't qualify as constant.
http://www.vbforums.com/showthread.php?t=420153
Quote:
Originally Posted by jmcilhinney
Well, at least I'm consistent! :) Basically the same answer, three and a half years apart. pacerier, hopefully this shows you why you should ALWAYS search before asking a question. There's a very high probability that you're not the first to ask it.
ok sry 'bout dat, i will try to do more searching in the future before posting