Login Page - Create Account

Support Board


Date/Time: Wed, 30 Apr 2025 11:24:35 +0000



Post From: Study won't exit?

[2025-04-21 14:34:14]
User431178 - Posts: 656
If it is false shouldn't the study become disabled and stop?

Not exactly, yes it will return, but not before running the message code.

If you place this at the top of the study it would immediately return, i.e. equivalent to disabling it.


if(sc.Input[0].GetYesNo() == false)
return;

But as you have the message code in the same block, that will always run.

Maybe consider using a persistent variable/flag that you can set, then only run the message portion if the flag is not set.


auto& r_FlagDisabled = sc.GetPersistentInt(0);

if(sc.Input[0].GetYesNo() == false || sc.LastCallToFunction)
{
if (r_FlagDisabled == 0)
{
sc.AddMessageToLog("INFO disconnected", 0);
r_FlagDisabled = 1;
}

return;
}