Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Can a function be cancelled (with event.cancel) from within the same function (e.g. using an "if" statement, [if ipc.elapsedtime()>T then event.cancel("xxx") end]),

or it can only be cancelled from outside (some other point of the lua script containing it) ?

Posted

Can a function be cancelled (with event.cancel) from within the same function (e.g. using an "if" statement, [if ipc.elapsedtime()>T then event.cancel("xxx") end]),

or it can only be cancelled from outside (some other point of the lua script containing it) ?

 

You can cancel anywhere. It won't affect the current execution, only the next time that event would have occurred.

 

Pete

Posted

In a specific case, looked like it was not cancelled, but it is difficult to pinpoint it.

I will dig in some further.

 

Don't forget you can use the Trace/Log option on the logging page to do line-by-line tracking. It also logs each time the event check occurs. You'd need to reload the plug-in after enablng the logging.

 

Pete

Posted

Mea culpa.

There is a logic mistake in my code (in some nested if's).

But then again, very useful to come in contact with you; I had forgotten about the Trace/Log facility.

Thanks again...and sorry about that.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.