最新的Web開發教程
 

ASP RemoveAll方法


<完整字典對象參考

刪除方法刪除從字典對象中的所有鍵/項目對。

句法

DictionaryObject.RemoveAll

<%
dim d,a,i
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "n","Norway"
d.Add "i","Italy"
d.Add "s","Sweden"

d.RemoveAll

Response.Write("<p>Key values:</p>")
a=d.Keys
for i=0 to d.Count-1
  Response.Write(a(i))
  Response.Write("<br>")
next

set d=nothing
%>

Output:

Key values:

(nothing)

<完整字典對象參考