Home AMX User Forum NetLinx Studio
Options

TIMELINE_KILL question

Is there any reason why I need to check to see if a TIMELINE is ACTIVE before I KILL it? I know it generates an error of invalid ID if it?s not ACTIVE to begin with but I?d like to know if there are any negative repercussions in performing a direct KILL.

Thanks,
Joe

Comments

  • Options
    AFAIK it's just a runtime error without any effect (I never have seen any)
  • Options
    DHawthorneDHawthorne Posts: 4,584
    I have always assumed runtime error = bad. You never know when it will have unforseen detrimental effects, including processor bog down while it handles the exeptions. So I always test if the timeline is active first. I also test any timeline I am starting up if outside of the DEFINE_START section. It would be nice, all that said, if the functions tested internally; it seems simple enough to do.
  • Options
    Originally posted by DHawthorne
    I have always assumed runtime error = bad.

    I absolutely agree :-)
  • Options
    I always thought runtime errors were only bad if you weren't expecting them. :)

    Seriously, if you call TIMELINE_KILL and get a "no such timeline" error, that shouldn't be a problem... Right?

    Where's our official AMX guys to answer this one?

    - Chip
  • Options
    DHawthorneDHawthorne Posts: 4,584
    Originally posted by Chip Moody
    Seriously, if you call TIMELINE_KILL and get a "no such timeline" error, that shouldn't be a problem... Right?

    - Chip
    Maybe, maybe not. There is usually added processing to handle this kind of exception, so it is probably more efficient to test first so it doesn't happen. If it only ha[ppens once in a while, or if the rest of your code is pretty simple, it probably doesn't matter. But get a real complex system, and such things can cause timing issues and other problems which are really hard to track down. It's entirly possible that the function actually does just test internally and spit out the message, making my argument moot. But unless I knew for sure, I'd rather it ran clean.
Sign In or Register to comment.