Scripting Runtime Library(Dictionary)

Dictionary °³Ã¼ÀÇ ¹®ÀÚ¿­ Å°¸¦ ºñ±³Çϱâ À§ÇÑ ºñ±³ ¸ðµå¸¦ ¼³Á¤Çϰųª ¹ÝȯÇÑ´Ù.

Àμö
object

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

: (¼Ó¼º ºÎ¿ï°ª)
¼Ó¼º°ªÀº ¼±ÅÃÀûÀÎ ¿ä¼ÒÀ̸ç, »ç¿ëÇϸé Àº ºñ±³ ¸ðµå¸¦ ³ªÅ¸³»´Â °ªÀÌ´Ù.
»ç¿ëÇÒ ¼ö ÀÖ´Â °ªÀº 0(ÀÌÁø), 1(ÅؽºÆ®), 2(µ¥ÀÌÅͺ£À̽º)°¡ ÀÖ´Ù.
2º¸´Ù Å« °ªÀº ƯÁ¤ ·ÎÄÉÀÏ ID(LCID)¸¦ ÂüÁ¶Çϴµ¥ »ç¿ëÇÒ ¼ö ÀÖ´Ù.

¼³¸í

¼³Á¤µÇ¾î ÀÖ´ÂCompareMode À» ¹Ýȯ¹Þ°Å³ª, »õ·Î ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.

ÀÌ¹Ì µ¥ÀÌÅÍ°¡ µé¾îÀÖ´Â Dictionary °³Ã¼ÀÇ ºñ±³ ¸ðµå¸¦ ¹Ù²Ù¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.

Key °ªÀº ´ë¼Ò¹®ÀÚ¸¦ ±¸º°ÇÏÁö ¾Ê´Â´Ù.


CompareMode ¼Ó¼º ¿¹Á¦

°á°ú Ç¥½Ãâ
JScript CompareMode ¼Ó¼º ¿¹Á¦ Ŭ¸¯
<SCRIPT language=JScript>
function CompareModeTest(key){
  var dicObj,str=''; // º¯¼ö¸¦ ¸¸µç´Ù.
  var BinaryCompare=0,TextCompare=1;
  dicObj=new ActiveXObject('Scripting.Dictionary'); // ºñ±³ ¸ðµå¸¦ ÅؽºÆ®·Î ¼³Á¤ÇÑ´Ù.
  dicObj.CompareMode=TextCompare;
  dicObj.Add('a','»ç°ú'); // Å°¿Í Ç׸ñÀ» Ãß°¡ÇÑ´Ù.
  dicObj.Add('b','¹Ù³ª³ª');
  dicObj.Add('c','ü¸®');
//  dicObj.Add('B','º¹¼þ¾Æ'); // 'b','¹Ù³ª³ª'°¡ ÀÖÀ¸¹Ç·Î ¿À·ù°¡ ¹ß»ýµÇ¾î ½ÇÆÐÇÑ´Ù.

  str+=dicObj.Item('a')+' '+dicObj.Item('b')+' '+dicObj.Item('c')+'<BR>'
  str+='dicObj.Item(key)='+dicObj.Item(key)+'<BR>'
  str+='dicObj.Count='+dicObj.Count;
  return str;
}
</SCRIPT>

<DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show
  onClick="id=showjs.innerHTML=CompareModeTest('c')">
 <SPAN class=ie>JScript</SPAN> <SPAN class=property>CompareMode</SPAN> ¼Ó¼º ¿¹Á¦ Ŭ¸¯</DIV>

VBScript·Î ¹Ýº¹

°á°ú Ç¥½Ãâ
VBScript CompareMode ¼Ó¼º ¿¹Á¦ Ŭ¸¯
<SCRIPT language=VBScript>
Function CompareModeTestvb(key)
Dim dicObj,str
Set dicObj=CreateObject("Scripting.Dictionary")
dicObj.CompareMode=vbTextCompare
dicObj.Add "a","»ç°ú"  ' Å°¿Í Ç׸ñÀ» Ãß°¡ÇÑ´Ù.
dicObj.Add "b","¹Ù³ª³ª"
dicObj.Add "c","ü¸®"
'dicObj.Add "B","º¹¼þ¾Æ" ' b ¹®ÀÚ°¡ Dictionary¿¡ ÀÌ¹Ì ÀÖÀ¸¹Ç·Î Add ¸Þ¼­µå´Â ½ÇÆÐÇÑ´Ù.
  str=str&dicObj.Item("a")&" "&dicObj.Item("b")&" "&dicObj.Item("c")&"<BR>"
  str=str&"dicObj.Item(key)="&dicObj.Item(key)&"<BR>"
  str=str&"dicObj.Count="&dicObj.Count
  CompareModeTestvb=str
End Function
</SCRIPT>

<DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV>
<DIV class=show
  onClick="showvb.innerHTML=CompareModeTestvb('c')">
<SPAN class=ie>VBScript</SPAN> <SPAN class=property>CompareMode</SPAN> ¼Ó¼º ¿¹Á¦ Ŭ¸¯</DIV>