Home AMX User Forum NetLinx Studio

Order of stuff in DEFINE_START

I just noticed something rather interesting....but I can't explain it. I have 3 things I need to do in DEFINE_START: a Timeline_Create for feedback, some variables initialing, and an INCLUDE statement.

If I do these in this particular order, the variables are constantly being initialized to these values in DEFINe_START so the program doesn't work properly. These variable aren't used at all in the included file.

DEFINE_START doesn't work

Timeline_Create
Include
variables

or

DEFINE_START doesn't work

Include
Timeline_Create
variables

DEFINE_START works as expected

Timeline_Create
variables
Include

It seems like the variables don't work if they come after the Include. But why? I've been in the habit of putting Include files in DEFINE_START as the help says you can put them anywhere, and it seems as good a place as any.

OP

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    I don?t know what?s included in your INCLUDE file but I?m guessing the INCLUDE is switching sections and when you come back you?re not really in DEFINE_START anymore.

    For the two cases that don?t work as expected try:

    DEFINE_START //your first doesn?t work example
    Timeline_Create
    Include
    DEFINE_START
    variables

    DEFINE_START //your second doesn't work example
    Include
    DEFINE_START
    Timeline_Create
    variables

    Do these two cases work correctly now?
  • Just don't send that code to tech support - they will complain about you having more than one DEFINE_START section and that must be what is wrong with your code.
  • Joe HebertJoe Hebert Posts: 2,159
    Hi Oliver,

    Just curious - did the multiple DEFINE_STARTs resolve the issue?
  • Joe Hebert wrote:
    Hi Oliver,

    Just curious - did the multiple DEFINE_STARTs resolve the issue?

    Joe

    I didn't try your suggestion - didn't have time and I'd send the code on to someone else to develop further. But I am still curious.

    OP
Sign In or Register to comment.