For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Array Insert/Remove/Size Usage?

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
LannFyre
OldUnreal Member
Posts: 157
Joined: Fri Mar 13, 2015 7:01 am

Array Insert/Remove/Size Usage?

Post by LannFyre »

Had a small code question for Array code. If the array I am using as a template is the output, how are Offset and Count used?

Code: Select all

Array_Insert (out array Ar, int Offset, optional int Count)
Array_Remove (out array Ar, int Offset, optional int Count)
Array_Size (out array Ar, optional int SetSize)
i tryin'a be a gud boi
User avatar
Bleeder91[NL]
OldUnreal Member
Posts: 1062
Joined: Sun Oct 04, 2009 7:22 pm

Re: Array Insert/Remove/Size Usage?

Post by Bleeder91[NL] »

Code: Select all

var() Array RandomDigits;

function MyFunction()
{
      local int ArraySize;
      
      Array_Insert(RandomDigits, 0, 5); //Add 5 empty entries at position [0] and onward.
      
      ArraySize = Array_Size(RandomDigits, 20); //Returns the Array's size, optionally changes the size to 20?
      
      Array_Remove(RandomDigits, 5, 15); //Remove 15 entries at position [5] and onward.
}
Last edited by Bleeder91[NL] on Fri Oct 21, 2016 1:12 pm, edited 1 time in total.
Image

Return to “UScript Board”