Scripting Runtime Library(Dictionary)
Dictionary °³Ã¼¿¡ ÁöÁ¤ÇÑ Å°°¡ ÀÖÀ¸¸é true¸¦, ±×·¸Áö ¾ÊÀ¸¸é false¸¦ ¹ÝȯÇÑ´Ù.
Dictionary °³Ã¼¿¡ ÁöÁ¤ÇÑ Å°°¡ ÀÖÀ¸¸é true¸¦, ±×·¸Áö ¾ÊÀ¸¸é false¸¦ ¹ÝȯÇÑ´Ù.
<SCRIPT language=JScript> function keyExists(k){ var dicObj,str=''; dicObj=new ActiveXObject('Scripting.Dictionary'); dicObj.Add('a','»ç°ú'); dicObj.Add('b','¹Ù³ª³ª'); dicObj.Add('c','ü¸®'); if (dicObj.Exists(k)) str+='ÁöÁ¤ÇÑ Å°°¡ ÀÖ´Ù.'; else str+='ÁöÁ¤ÇÑ Å°°¡ ¾ø´Ù.'; return(str); } </SCRIPT>
<SCRIPT language=VBScript> Function KeyExistsTestvb Dim dicObj,msg ' º¯¼ö¸¦ ¸¸µç´Ù. Set dicObj=CreateObject("Scripting.Dictionary") dicObj.Add "a","»ç°ú" ' Å°¿Í Ç׸ñÀ» Ãß°¡ÇÑ´Ù. dicObj.Add "b","¹Ù³ª³ª" dicObj.Add "c","ü¸®" If dicObj.Exists("c") Then msg="ÁöÁ¤ÇÑ Å°°¡ ÀÖ´Ù." Else msg="ÁöÁ¤ÇÑ Å°°¡ ¾ø´Ù." End If KeyExistsTestvb=msg End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=KeyExistTestvb('b')">VBScript <SPAN class=method>Exists</SPAN>