guy wrote:
found this oddity-
copying a vb6 function with optional parameters and pasting it into a vb2003
class, for conversion purposes, it all works fine except that the collapsing
"-" on the LHS goes away, only to return if "Optional" is removed. Strange.
anyone else had this?
One thought: In VB6, you could just say "Optional param As type" and be
done with it, but in VB.NET "Optional parameters must specify a default
value" so if you just copy this valid in VB6) syntax into VB.NET:
Public Sub T(ByVal a As Integer, Optional ByVal g As Integer)
End Sub
you will get a squiggly line under the ), and no - collapsing section,
because it doesn't compile. Change it to eg
Public Sub T(ByVal a As Integer, Optional ByVal g As Integer = 0)
End Sub
and you get your - collapsing section.
--
Larry Lard
Replies to group please