Difference between revisions of "Papyrus FAQs"

Jump to navigation Jump to search
108 bytes added ,  14:13, 25 May 2016
imported>Digitalparanoid
imported>Digitalparanoid
Line 290: Line 290:
=== How do I create a dynamic array? ===
=== How do I create a dynamic array? ===


According to SmkViper:
Dynamic arrays grow to fit the number of elements.


<pre>
To create an empty dynamic array, pass <code>0</code> as the size.
Arrays are now dynamic. To create an empty array, pass 0 as the size. You are
 
now allowed to pass in a variable or calculation for an array size, and you can
<code>
call add and remove on the array to add and remove items.
ObjectReference[] dynamicArray = new ObjectReference[0]
</pre>
</code>
 
Also:
 
* You can pass in a variable or calculation for the array size.
* You can call <code>Add()</code> and <code>Remove()</code> on the array to add and remove items.


=== How do I create key-value pairs? ===
=== How do I create key-value pairs? ===

Navigation menu