In one of my projects, I had a need for dynamic arrays, so I decided to implement it using the data table. I suppose this might be something other people could use, so I put the code into a seperate map, and uploaded it here.
Many of my methods have two functions. One that returns an error code, and one that returns nothing. The one that returns nothing just calls the other one. Also, if an error occurs the method will print an error message as a debugging text message. You can disable that by setting the silent mode variable to true.
I only implemented support for integer, boolean and unit variables as this was the only ones I needed in my project. It's not hard to make support for other types, so if someone is interested, you can either do it yourself, or poke me. I just don't want to do it if no one is interested.
It seems to work when I used it, but I can't guarantee that it is bug free. Also, it is probally not as efficient as a normal array - it depends on how blizzard implemented the data table. The functions could be made with fewer lookups in the data table - my primary focus was getting it done with few errors.
Ill add the map in a reply to this post since it seems I can't add attachments here.
In one of my projects, I had a need for dynamic arrays, so I decided to implement it using the data table. I suppose this might be something other people could use, so I put the code into a seperate map, and uploaded it here.
Many of my methods have two functions. One that returns an error code, and one that returns nothing. The one that returns nothing just calls the other one. Also, if an error occurs the method will print an error message as a debugging text message. You can disable that by setting the silent mode variable to true.
I only implemented support for integer, boolean and unit variables as this was the only ones I needed in my project. It's not hard to make support for other types, so if someone is interested, you can either do it yourself, or poke me. I just don't want to do it if no one is interested.
It seems to work when I used it, but I can't guarantee that it is bug free. Also, it is probally not as efficient as a normal array - it depends on how blizzard implemented the data table. The functions could be made with fewer lookups in the data table - my primary focus was getting it done with few errors.
Ill add the map in a reply to this post since it seems I can't add attachments here.
Here