Home AMX User Forum AMX General Discussion

DEV Array

Hi Guys,

Can someone please tell me if the below is possible and if so why it wouldn't be working?
DEV dvTelevisions[10]

dvTelevisions[1] = 0:11:0
...etc

DEFINE_EVENT
DATA_EVENT[dvTelevisions] (tried with [10])
{
STRING:
{
SEND_STRING dvDebug,"'DEBUG: TV: ',ITOA(GET_LAST(dvTelevisions))"
}
}

This is just hypothetical code by the way.

Thanks,

Cameron

Comments

  • ericmedleyericmedley Posts: 4,177
    Cameron wrote: »
    Hi Guys,

    Can someone please tell me if the below is possible and if so why it wouldn't be working?
    DEV dvTelevisions[10]
    
    dvTelevisions[1] = 0:11:0
    ...etc
    
    DEFINE_EVENT
    DATA_EVENT[dvTelevisions] (tried with [10])
    {
    STRING:
    {
    SEND_STRING dvDebug,"'DEBUG: TV: ',ITOA(GET_LAST(dvTelevisions))"
    }
    }
    

    This is just hypothetical code by the way.

    Thanks,

    Cameron

    Define_Variable

    Volatile dev dvTelevisions[]=
    {
    dvTelevisions1,
    dvTelevisions2,
    dvTelevisions3
    }

    This should have been covered in your programmer class. You can also read the help file in NS and search for Dev Arrays. There are examples of code.
  • CameronCameron Posts: 56
    ericmedley wrote: »
    This should have been covered in your programmer class. You can also read the help file in NS and search for Dev Arrays. There are examples of code.

    It probably will be, I'm only Programmer 1 atm - got told I shouldn't do higher for at least 12 months, although I already use Timelines etc. meh.

    Thanks heaps for the reply, I will do it that way, for some reason I just wanted to do it the dvTelevisions[*integer*] = 0:12:0 way all good but :)

    Thanks again,

    Cameron
  • DHawthorneDHawthorne Posts: 4,584
    Do you realize that device number 0 is the master itself and anything in the 0:x:0 range has to be an IP device? The master has no physical ports, so any device defined on the master itself is IP. If you knew that, well, never mind :) ... I just thought it unlikely if you just finished P1 training that you are messing with IP devices already, unless you have someone else's module.

    And don't listen to them about waiting 12 months for P2. Move up when you feel you are ready. Most of what they teach in both classes is simply groundwork, and your real learning is going to happen when you sit down and work on real projects.
  • CameronCameron Posts: 56
    Yep, it is an IP device haha. I just kept the devID when I copied it.

    I learnt from an old trainer in a one-on-one and have been learning on the job so I have a fairly good grip on a fair bit of it :)

    I guess so, should talk to my boss about getting me in - P1 was good to learn a few things I didn't know about
  • jjamesjjames Posts: 2,908
    Indeed - one-on-one training is great and is a tremendous help even if you don't fully grasp it right away, but P1 & P2 are essential to learning the basics of AMX.

    Plus, it's the only pathway to certification for a new programmer, if you or your boss is interested in that.

    Best of luck!
  • Cameron wrote: »
    Thanks heaps for the reply, I will do it that way, for some reason I just wanted to do it the dvTelevisions[*integer*] = 0:12:0 way
    You could use REBUILD_EVENT to get what you're looking for, but I wouldn't recommend it.
Sign In or Register to comment.