How Can the application stop for show error message

I can’t get that the apllication when doesn’t give any error execute sc_exit(sel) and on other case I want to show the ok button for the user can read th error message.
Always execute sc_exit(ok) although there isn’t any error.
Is there any way to do that.?
thanks

try {
_sql_execPost($sql,true);
sc_exit(sel);
}
catch (Exception $e)
{
sc_error_message(($e->getMessage()));
sc_error_exit();
{sc_exit(ok);}

}

My english is no very well but I translate the text
I can’t get that the apllication when doesn’t give any error execute sc_exit(sel) and on other case I want to show the ok button for the user can read th error message.
Always execute sc_exit(ok) although there isn’t any error.
Is there any way to do that.?
thanks

try {
_sql_execPost($sql,true);
sc_exit(sel);
}
catch (Exception $e)
{
sc_error_message(($e->getMessage()));
sc_error_exit();
{sc_exit(ok);}

}

You can write your post in Spanish, I believe people here will understand. But first, my question is: _sql_execPost($sql,true); is a function created by you? If so, what do you have in there?

1 Curtida

_sql_execPost es una customed function of mine. I have change it .
the problem is when there is not error then program alwways execute sc_exit(ok) and so a window is showed with the button OK
try {
throw error(“error”);
sc_exit(sel);
}
catch (Excepción $e)
{
sc_error_message(($e->getMessage()));
sc_error_exit();
{sc_exit(ok);
}

You should show your customized function here… another point is that you cannot use sc_error with sc_exit… try first using sc_error… only.

the code is inside a php button in Grid application
sc_error_message doesn’t show anything though echo command it does. I have remove sc_exit(ok) and echo is showed but it dissapared in 0.5 seg.
but if put in sc_exit(ok) when it doesn’t happen error, it shows too

Ok, which app is this? A Form? a Grid? or what? And which event is your code located?
Another thing is to put an echo in your _sql_execPost($sql,true); to see exactly what is returning.

the php button is Grid application.
_sql_exec may return null or throw new error(“error”)
my problem is when there is no error the function doesn’t stop and doesn’t show ok button (sc_exit(sel))
and when were and error display error and ok button

it is weird then sc_error_message not show anything inside php button