Dialog close function. How to pass data?

Dialog close function. How to pass data?

How do you pass data to the close function of the dialog?