Anyway to Update an Array (List) values at sepecific index?

Hi,

Ok what I have is an array, with X amount of items in it. I want to change the value of one item, say at index 2 for example.

Can you do this? Icant find a way?
Or do I have to manually go through it and re-create it?

This is what I have curently,its long winded and I am sure there is a better way?

:local WDSIPS "192.168.1.232,192.168.1.233,192.168.1.234,192.168.1.235,192.168.1.236,192.168.1.237"
:set WDSIPS [:toarray $WDSIPS]
:local WDSIPStatus "1,1,1,1,1,1"
:set WDSIPStatus [:toarray $WDSIPS]

:local intVal2 0
:local TempStatus ""
:local IPAddress "192.168.1.235"

:foreach TempIPAddress in=$WDSIPS do={
   :local newval 0
      :if ($IPAddress != $TempIPAddress) do={
      :set newval [:pick $WDSIPStatus $intVal2 ($intVal2 + 1)]
   }
   :set TempStatus ($TempStatus . $newval . ",")

   :set intVal2 ($intVal2+1)
}
:set WDSIPStatus [:pick $TempStatus 0 ([:len $TempStatus]-1)]
:set WDSIPStatus [:toarray $WDSIPStatus]

You will have to re-create your array, to update item with specific index.