Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Mupp on September 07, 2021, 03:48:53 PM

Title: Moving items in an array
Post by: Mupp on September 07, 2021, 03:48:53 PM
This is not about arraymaker.
How can I remove the last item in an array, move all the rest items down one step and add a new in the first slot without messing things up?
Also, do you always have to resize the array if you remove/add or is that done automatically?
Title: Re: Moving items in an array
Post by: djaydino on September 07, 2021, 06:28:47 PM
Hi.
if you do this regular you should use array maker instead.

Array maker actually uses <Lists> and is better for something like this.

Wit array list you can do :
Array List Add (store Index)
Array List Move (index Mover from (stored Index), Index Move To (0)
Array List Remove At (stored Index)

In sequence

For array instead of doing Remove At use 'Array Delete At'
This way you should not need to do resize.
Title: Re: Moving items in an array
Post by: Mupp on September 07, 2021, 07:44:49 PM
Thanks, now I get the difference between the 2 array systems.

Problem, I can't find any action called move.
Title: Re: Moving items in an array
Post by: djaydino on September 08, 2021, 02:11:47 PM
Hi.
Array List move should be in the array maker package.

Array move does not exist