Issue with OnStop function

Discussions about CSEntry
Post Reply
TudorPopescu
Posts: 7
Joined: December 11th, 2023, 6:59 am

Issue with OnStop function

Post 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;
Attachments
HBS.zip
(591.14 KiB) Downloaded 79 times
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Issue with OnStop function

Post 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
TudorPopescu
Posts: 7
Joined: December 11th, 2023, 6:59 am

Re: Issue with OnStop function

Post by TudorPopescu »

Thanks
Post Reply