BC30812: Optional parameters must specify a default value
Optional parameters must provide default values that can be used if no parameter is supplied by a calling procedure.
Error ID: BC30812
Example
The following example generates BC30812:
Sub Proc1(x As Integer, Optional y As String)
Console.WriteLine("Default argument is: " & y)
End Sub
To correct this error
Specify default values for optional parameters:
Sub Proc1(x As Integer, Optional y As String = "Default Value")
Console.WriteLine("Default argument is: " & y)
End Sub
See also
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.