function onTest(ev) { Pm.Debug("onClose"); } var oForm = pMe.Form; oForm.AddEvent("onClose", "sFuncId", onTest);