Dictionary °³Ã¼ÀÇ ¹®ÀÚ¿ Å°¸¦ ºñ±³Çϱâ À§ÇÑ ºñ±³ ¸ðµå¸¦ ¼³Á¤Çϰųª ¹ÝȯÇÑ´Ù.
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó Dictionary °³Ã¼ÀÇ À̸§ÀÌ´Ù.
¼³Á¤µÇ¾î ÀÖ´ÂCompareMode À» ¹Ýȯ¹Þ°Å³ª, »õ·Î ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.
ÀÌ¹Ì µ¥ÀÌÅÍ°¡ µé¾îÀÖ´Â Dictionary °³Ã¼ÀÇ ºñ±³ ¸ðµå¸¦ ¹Ù²Ù¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.
Key °ªÀº ´ë¼Ò¹®ÀÚ¸¦ ±¸º°ÇÏÁö ¾Ê´Â´Ù.
<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>
<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>