C CJ Taylor Sep 19, 2003 #2 public sub mySub(Optional myVar as Datatype = [defaultvalue]) where Datatype is the color type and default value is, well the default value...
public sub mySub(Optional myVar as Datatype = [defaultvalue]) where Datatype is the color type and default value is, well the default value...
A Armin Zingler Sep 19, 2003 #3 CJ Taylor said: public sub mySub(Optional myVar as Datatype = [defaultvalue]) where Datatype is the color type and default value is, well the default value... Click to expand... ....but the default value must be a constant expression, so it is better to add an overloaded version like public sub mySub() mySub(Color.white) end sub ;-)
CJ Taylor said: public sub mySub(Optional myVar as Datatype = [defaultvalue]) where Datatype is the color type and default value is, well the default value... Click to expand... ....but the default value must be a constant expression, so it is better to add an overloaded version like public sub mySub() mySub(Color.white) end sub ;-)
H Herfried K. Wagner [MVP] Sep 19, 2003 #4 Hello, Cc said: how to declare optinal argument if datatype are color Click to expand... Optional parameters must not be structures. Create multiple overloads: \\\ Public Overloads Sub Bla() Bla(Color.Red) End Sub Public Overloads Sub Bla(ByVal Foo As Color)
Hello, Cc said: how to declare optinal argument if datatype are color Click to expand... Optional parameters must not be structures. Create multiple overloads: \\\ Public Overloads Sub Bla() Bla(Color.Red) End Sub Public Overloads Sub Bla(ByVal Foo As Color)
H Herfried K. Wagner [MVP] Sep 19, 2003 #5 Hello, CJ Taylor said: public sub mySub(Optional myVar as Datatype = [defaultvalue]) where Datatype is the color type and default value is, well the default value... Click to expand... Optional parameters must not be structure types.
Hello, CJ Taylor said: public sub mySub(Optional myVar as Datatype = [defaultvalue]) where Datatype is the color type and default value is, well the default value... Click to expand... Optional parameters must not be structure types.