# Bug in tutorial source code

This topic is 4429 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

There seems to be a bug in lines 122 and 124 of the tutorial source code's main.cpp for both 2.4.1d and 2.5.0WIP2. They relevant source is currently:
	if( r != asEXECUTION_FINISHED )
{
// The execution didn't finish as we had planned. Determine why.
if( asEXECUTION_ABORTED )
cout << "The script was aborted before it could finish. Probably it timed out." << endl;
else if( asEXECUTION_EXCEPTION )
{

It looks like it should be:
	if( r != asEXECUTION_FINISHED )
{
// The execution didn't finish as we had planned. Determine why.
if( r == asEXECUTION_ABORTED )
cout << "The script was aborted before it could finish. Probably it timed out." << endl;
else if( r == asEXECUTION_EXCEPTION )
{

Currently it appears to always executes the asEXECUTION_ABORTED branch even if there was an exception (such as a divide by 0) or something weird happened.

##### Share on other sites
Heh! Silly mistake.

I'll fix it for the next release. Thanks for letting me know.

Does this mean that you checking out my library for a project of yours? [wink]

##### Share on other sites
No project. Just checking it out. :)