Home AMX User Forum AMX General Discussion

An array of user defined structures...

...is not possible in Netlinx right?

I miss .NET List<> and being able to dynamically create lists of my user defined objects. And objects that can have methods for that matter.

Comments

  • svTechsvTech Posts: 44
    You can't dynamically create arrays of structures, but you certainly can define arrays of structures like any other variable.
  • BigsquatchBigsquatch Posts: 216
    svTech wrote: »
    You can't dynamically create arrays of structures, but you certainly can define arrays of structures like any other variable.

    When I try to do it I get an error: "Initializer is not a constant"
  • Joe HebertJoe Hebert Posts: 2,159
    Bigsquatch wrote: »
    When I try to do it I get an error: "Initializer is not a constant"

    Can you show us the code?
    Arrays of user defined structs are definitely legal.
  • BigsquatchBigsquatch Posts: 216
    Joe Hebert wrote: »
    Can you show us the code?
    Arrays of user defined structs are definitely legal.

    Now that I think about it, I have done this in the past. I've already moved on and don't have the code anymore.

    I think the mistake I was making is that I was trying to initialize the array with with some existing instances of the structure. Just like how you would add objects to a List in C#. I don't know why I thought that would work.
Sign In or Register to comment.