Page 1 of 1

Issue with OnStop function

Posted: February 1st, 2024, 2:51 am
by TudorPopescu
Hello,
I'm having problems with the onstop function. The reenter instruction does not work when I click Cancel. When you click this button, the application does not remain open but stops. What is the problem? I'm using CSPro 7.7.3.

If I press CTRL + S then everything works fine. Doesn't work when I click Close (X) in the window. Is there any way to fix this? I assume that the logic works, but because when X is pressed it means kill process and the logic is not executed

Code: Select all

function OnStop()

	numeric response = errmsg(tr(00112))
		select(
				tr(00003), continue, 
				tr(00004), continue, 
				tr(10052), continue
			);

	if response = 3 then
		// Cancel
		reenter;

	elseif response = 1 then
		// Save and quit
		if savepartial() then 
			openMenu(tr(10065));
		else
			errmsg(tr(10066));
		endif;

	endif;

	stop(1); // close the program

end;

Re: Issue with OnStop function

Posted: February 1st, 2024, 2:59 pm
by justinlakier
Hello,

This is an error when closing with the (X) button, which will be fixed in CSPro 8.0 when it releases tomorrow.

Hope this helps,
Justin

Re: Issue with OnStop function

Posted: February 2nd, 2024, 2:53 am
by TudorPopescu
Thanks