Open main menu
Home
Random
Log in
Settings
About the CreationKit Wiki
Disclaimers
the CreationKit Wiki
Search
Editing
ResizeIntArray - Utility
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples == <syntaxhighlight lang="papyrus"> ; let's make array length equal to available perk points, and fill all elements with 9 ; ...this should really be using the "create" function, not "resize" int[] pointsArray pointsArray = Utility.ResizeIntArray(pointsArray, Game.GetPerkPoints(), 9) ; Let's resize an existing array, someArray, expanding it by one element. The fill value (in this case, not specified so the default of zero) will be used for new elements (in this case, the last one) and all other element values will remain the same as they were before being resized. someArray = Utility.ResizeIntArray(someArray, someArray.Length + 1) ; Let's resize an existing array, someArray, by making it one element shorter. The removed element, would be the last one in the array. The data in all other elements should be unchanged. ; NOTE 1: this is not "safe" code, it could theoretically try to Resize the array to zero length (if it's currently 1) which Resize will not allow, resulting in an error in the papyrus log. Use "Create" versions if you need to shrink an existing array to zero elements. ; NOTE 2: The autofill value is meaningless and ignored when shrinking an array. someArray = Utility.ResizeIntArray(someArray, someArray.Length - 1) </syntaxhighlight>
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)