DynamicArray add element - General - Algorand
DynamicArray add element
post by MatBarons on May 31, 2023
Hi everyone,
I’m new to Algorand and I’m having some difficulties on Boxes and Arrays. I need to store an array into a box and, when asked, to add an element to that array. The array element type is a custom class I created.
The main problem is that I can’t find a way to add the element once I retrieve the array from the box.
post by fabrice on May 31, 2023
Can you show the Array custom class you used?
post by MatBarons on May 31, 2023
The array type isn’t custom, I used DynamicArray. However the elements in the array are custom type. The problem is that I can’t find a way to add an element to the array, even if the element type is a base type.
For example, there is not .add() method and the .set() method doesn’t work that way.