Arrays 如何在ASP classic中取消设置数组元素?

Arrays 如何在ASP classic中取消设置数组元素?,arrays,asp-classic,unset,Arrays,Asp Classic,Unset,是否存在与PHPunset(array1[3])函数等效的ASP经典函数?我想对于数字数组,至少可以这样做: 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

是否存在与PHP
unset(array1[3])
函数等效的ASP经典函数?

我想对于数字数组,至少可以这样做:

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
子未设置(数组、索引)
如果索引ubound(array),则退出sub
我,行动
move=false
对于i=lbound(数组)到ubound(数组)
如果i=index,则move=true
如果move和i
我想对于数字数组,这至少可以做到:

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
子未设置(数组、索引)
如果索引ubound(array),则退出sub
我,行动
move=false
对于i=lbound(数组)到ubound(数组)
如果i=index,则move=true
如果move和i
这将帮助我们这些不懂PHP的人描述
unset
函数应该做什么。为什么要使用它?在ASP中,一旦数组被拆分,我们通常会为数组使用不同的变量名,因此不需要取消数组。PHP中的Unset()会破坏给定的变量/数组元素。在我的例子中,我需要删除数组中间的一个元素。它会帮助那些不知道PHP的人来描述<代码>未设置函数应该做什么。为什么要使用它呢?在ASP中,一旦数组被拆分,我们通常会为数组使用不同的变量名,因此不需要取消数组。PHP中的Unset()会破坏给定的变量/数组元素。对于我的情况,我需要在数组中间删除一个元素。