# How to use OPTIONAL parameters

- How to use OPTIONAL parameters
  - The Program:
  - The Code:
  - The Source

## The Program:

If you click the first Button, the label shows the text: "Ernie + Bert".
If you click the second Button, the label shows the text: "Ernie".
Just one method is used. This method has two parameters, and one of them is defined as optional.

## The Code:

    STATIC PUBLIC SUB Main()
      hForm AS Fmain
      hForm = NEW Fmain
      hForm.show
    END

    PUBLIC SUB Button1_Click()
      hello("Ernie", " + Bert")
    END

    PUBLIC SUB Button2_Click()
      hello("Ernie")
    END

    PUBLIC SUB hello(strErnie AS String, OPTIONAL strBert AS String)
      TextLabel1.Text= strErnie & strBert
    END

## The Source

Download