Scripting Runtime Library(Dictionary)

RemoveAll ¸Þ¼­µå´Â Dictionary °³Ã¼¿¡¼­ Å°-Ç׸ñ ½ÖÀ» ¸ðµÎ Á¦°ÅÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
object

ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, object´Â Ç×»ó Dictionary °³Ã¼ÀÇ À̸§ÀÌ´Ù.

ÆĶó¸ÞÅÍ

ÆĶó¸ÞÅÍ´Â ¾ø´Ù.

¹Ýȯ°ª

¹Ýȯ°ªÀº ¾ø´Ù.

¼³¸í

RemoveAll ¸Þ¼­µå´Â Dictionary °³Ã¼¿¡¼­ Å°-Ç׸ñ ½ÖÀ» ¸ðµÎ Á¦°ÅÇÑ´Ù.


RemoveAll ¸Þ¼­µå ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript RemoveAll ¸Þ¼­µå ¿¹Á¦
<SCRIPT language=JScript>
function RemoveAllTest(){
  var KeyArr,DicArr,dicObj,numb,str=''; // º¯¼ö¸¦ ¸¸µç´Ù.
  dicObj=new ActiveXObject('Scripting.Dictionary');
  dicObj.Add('a','»ç°ú'); // Å°¿Í Ç׸ñÀ» Ãß°¡ÇÑ´Ù.
  dicObj.Add('b','¹Ù³ª³ª');
  dicObj.Add('c','ü¸®');
  KeyArr=new VBArray(dicObj.Keys()).toArray(); // Key Ç׸ñÀ» °¡Á®¿Â´Ù.
  DicArr=new VBArray(dicObj.Items()).toArray(); // Ç׸ñÀ» °¡Á®¿Â´Ù.
  for (numb in DicArr){ // dictionary¸¦ ¹Ýº¹ÇÑ´Ù.
    str+=numb+') "'+KeyArr[numb]+'"='+DicArr[numb]+'<BR>';
  }
  str+='dicObj.Count='+dicObj.Count+'<BR><BR>';

  dicObj.RemoveAll(); // ¸ðµç ½ÖÀ» Á¦°ÅÇÑ´Ù.
  str+='dicObj.RemoveAll()<BR>';
  str+='dicObj.Count='+dicObj.Count;
  return(str);
}
</SCRIPT>

<DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="id=showjs.innerHTML=RemoveAllTest('b')">
  <SPAN class=ie>JScript</SPAN> <SPAN class=method>RemoveAll</SPAN> ¸Þ¼­µå ¿¹Á¦</DIV>
°á°ú Ç¥½Ãâ
VBScript RemoveAll ¸Þ¼­µå ¿¹Á¦
<SCRIPT language=VBScript>
Function RemoveAllTestvb
  Dim KeyArr,DicArr,dicObj,numb ' º¯¼ö¸¦ ¸¸µç´Ù.
  str=""
  Set dicObj=CreateObject("Scripting.Dictionary")
  dicObj.Add "a","»ç°ú" ' Å°¿Í Ç׸ñÀ» Ãß°¡ÇÑ´Ù.
  dicObj.Add "b","¹Ù³ª³ª"
  dicObj.Add "c","ü¸®"

  KeyArr=DicObj.Keys ' Å°¸¦ °¡Á®¿Â´Ù.
  DicArr=DicObj.Items ' Ç׸ñÀ» °¡Á®¿Â´Ù.
  For numb=0 To DicObj.Count-1 ' dictionary¸¦ ¹Ýº¹ÇÑ´Ù.
    str=str&"'"&KeyArr(numb)&"' : "&DicArr(numb)&"<BR>" ' °á°ú¸¦ ¹ÝȯÇÑ´Ù.
  Next
  str=str&"dicObj.Count="&dicObj.Count&"<BR><BR>"

  str=str&"dicObj.RemoveAll<BR>"
  dicObj.RemoveAll ' ¸ðµç ½ÖÀ» Á¦°ÅÇÑ´Ù.
  str=str&"dicObj.Count="&dicObj.Count

  RemoveAllTestvb=str
End Function
</SCRIPT>

<DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show onClick="showvb.innerHTML=RemoveAllTestvb()">
  <SPAN class=ie>VBScript</SPAN> <SPAN class=method>RemoveAll</SPAN> ¸Þ¼­µå ¿¹Á¦</DIV>