Home AMX User Forum NetLinx Studio

Why Won't this Work?

DEFINE_VARIABLE
VOLATILE INTEGER nKPDevAssign[16][3][8]

DEFINE_START
nKPDevAssign[1][1]={1,3,2,0,13,0,0,0}

I'm drawing a blank. Thanks.

Comments

  • jjamesjjames Posts: 2,908
    I may be wrong, but I don't you can define it like that. You'll have to do something like this:
    DEFINE_VARIABLE 
    VOLATILE INTEGER nKPDevAssign[16][3][8]=
    {
      {1,3,2,0,13,0,0,0}
     ,{1,3,2,0,13,0,0,2}
     ,{1,3,2,0,13,0,0,3}
     ,{1,3,2,0,13,0,0,4}
     //etc....
    }
    

    I think it may be safe to say, if you can't do it in a BUTTON_EVENT, you can't do it in DEFINE_START.
  • ericmedleyericmedley Posts: 4,177
    jjames wrote: »
    I may be wrong, but I don't you can define it like that. You'll have to do something like this:
    DEFINE_VARIABLE 
    VOLATILE INTEGER nKPDevAssign[16][3][8]=
    {
      {1,3,2,0,13,0,0,0}
     ,{1,3,2,0,13,0,0,2}
     ,{1,3,2,0,13,0,0,3}
     ,{1,3,2,0,13,0,0,4}
     //etc....
    }
    

    I think it may be safe to say, if you can't do it in a BUTTON_EVENT, you can't do it in DEFINE_START.

    Actually, that didn't compile for me.

    But this did.. And now my head hurts...
    VOLATILE INTEGER nKPDevAssign[16][3][8]=
    {
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}},
      {{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0},{1,3,2,0,13,0,0,0}}
    }
    
    
  • TurnipTruckTurnipTruck Posts: 1,485
    Sorry about the headache. Thanks for the help.
  • jjamesjjames Posts: 2,908
    ericmedley wrote: »
    Actually, that didn't compile for me.

    But this did.. And now my head hurts...

    Oops, that's what I meant. Thanks!

    At least you caught my drift! :D
  • Jeff BJeff B Posts: 37
    DEFINE_VARIABLE
    VOLATILE INTEGER nKPDevAssign[16][3][8]
    
    DEFINE_START
    nKPDevAssign[1][1]={1,3,2,0,13,0,0,0}
    

    I'm drawing a blank. Thanks.

    You can not assign integer values this way. But this will work.

    DEFINE_VARIABLE
    CHAR nKPDevAssign[16][3][8]

    DEFINE_START
    nKPDevAssign[1][1]={1,3,2,0,13,0,0,0}


    Keep in mind this only allows for values from 0 to 255.

    JB
Sign In or Register to comment.