How to use OPTIONAL parameters
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.
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
Download
Referenced by :