Yes, or find an alternate method of closing things down.
I used to use that method myself and stopped using it for exactly that reason - now I set the errorcode via the globstruct and return from the function, letting DBPro's own error system do the work for me:
void __cdecl RaiseError(int ErrorNo)
{
*(int*)GetCore()->g_pErrorHandlerRef = ErrorNo;
}
The numbers already allocated are in the file C:\Program Files\Dark Basic Software\Dark Basic Professional\Compiler\lang\english\Errors.txt in the section [RUNTIME] on my system - for example 7008 is 'Object does not exist'.