0

是否有等效于 PHPunset(array1[3])函数的 ASP Classic?

4

1 回答 1

3

我想这对于数字数组来说至少可以做到:

sub unset(array, index)
   if index < lbound(array) or index > ubound(array) then exit sub

   dim i, move
   move = false
   for i = lbound(array) to ubound(array)
      if i = index then move = true

      if move and i < ubound(array) then
         array(i) = array(i + 1)
      end if
   next

   redim preserve array(i - 2)  
end sub
于 2013-04-29T00:46:46.753 回答