.. highlightlang:: us .. index:: AppOnCloseCallback .. _apponclosecallback: AppOnCloseCallback ================== .. us.tag AppOnCloseCallback ENGLISH App New5603 :ref:`AppOnCloseCallback` will be invoked, when UniPlot is closed. The function must be provided by the user. .. function:: bool = AppOnCloseCallback() .. us.return **Return Value** If the function succeeds, the return should be TRUE (1). The return value is ignored. .. us.example **Example** Write a log file. :: def AppOnCloseCallback() { ssName = GetUserName(); ssComputerName = getenv("USERDOMAIN"); ssDate = DT_Format(DT_GetCurrentTime(), "%c"); ssText = sprintf("UniPlot quit: User=%s, Computer=%s, Date = %s\n", ssName, ssComputerName, ssDate); ssFile = sprintf("z:\\%s_userlog.txt", ssName); fh = fopen(ssFile, "a+t") if (fh) { fwrite(fh, ssText); fclose(fh); } return TRUE; } .. seealso:: :ref:`overview-application-object`, :ref:`AppSetBar` :sub:`id-69213`