Scripting Runtime Library(Dictionary)

Dictionary °³Ã¼¿¡ ÁöÁ¤ÇÑ Å°°¡ ÀÖÀ¸¸é true¸¦, ±×·¸Áö ¾ÊÀ¸¸é false¸¦ ¹ÝȯÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
objectName
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Ç×»ó Dictionary °³Ã¼ÀÇ À̸§ÀÌ´Ù.
key
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Dictionary °³Ã¼¿¡¼­ °Ë»öÇÒ Key °ªÀÌ´Ù.
¹Ýȯ°ª

Dictionary °³Ã¼¿¡ ÁöÁ¤ÇÑ Å°°¡ ÀÖÀ¸¸é true¸¦, ±×·¸Áö ¾ÊÀ¸¸é false¸¦ ¹ÝȯÇÑ´Ù.


Exists ¸Þ¼­µå ¿¹Á¦

°á°ú Ç¥½Ãâ
Jscript Item ¿¹Á¦
<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>