<html>
<head>
<title>Dictionary IuWFNg</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="">
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
<tr>
<td valign="top" class="NAME">Dictionary IuWFNg</td>
<td valign="top" class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">쐬\</td>
</tr>
<tr>
<td colspan="2" class="description">

<p>͂</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Cu</td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Microsoft Scripting Runtime</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Dictionary IuWFNg Collection IuWFNgɎĂ܂APerl Azzɑ܂ɊÂĂ邱ƂقȂ܂BDictionary IuWFNǵAz Collection IuWFNĝ悤ɁAf[^܂<em></em>܂<em>o[</em>ƌĂ΂vfێ܂B܂AIuWFNg⑼ Dictionary IuWFNgȂǁAǂ̂悤ȃf[^ł܂ނƂł܂BzƂ̂悤ɍڂ̏gp̂ł͂ȂAf[^ƋɊi[ĂŗL<em>L[</em> (܂͖Otl) gpāA̎ڂ̒lɃANZX܂B̂߁AŗL̖OtlɊ֘AtĂf[^ɃANZXKvƂɁADictionary IuWFNg͍œKłB
</p>

<p>Dictionary IuWFNgɊi[ĂeڂɃANZXɂ́A<span class="LITERAL">For</span> <span class="LITERAL">Each ...Next</span> \gp܂BADictionary IuWFNǵA̒Ɋi[Ăf[^l܂܂ꂽoG[VԂ̂ł͂ȂAo[Ɋ֘AtĂL[܂܂ꂽoG[VԂ܂B̗̂悤ɁÃL[ Item \bhɓnăo[o܂B
</p>

<span class="PROGRAMLISTING"><pre>Dim vKey 
Dim sItem, sMsg 
Dim oDict 
    
Set oDict =  CreateObject("Scripting.Dictionary")
oDict.Add "One", "Engine"
oDict.Add "Two", "Wheel"
oDict.Add "Three", "Tire"
oDict.Add "Four", "Spanner"
        
For Each vKey In oDict
   sItem = oDict.Item(vKey)
   sMsg = sMsg &amp; sItem &amp; vbCrLf
Next
   
MsgBox sMsg</pre></span>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Dictionary IuWFNg̃vpeB</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Dictionary IuWFNgɂ͎ 4 ̃vpeB܂܂܂B</p>

<table border="1">



<thead>
<tr valign="top">
<td>
<p>vpeB</p>
</td>
<td>
<p></p>
</td>
</tr>
</thead>
<tbody>
<tr valign="top">
<td>
<p>CompareMode</p>
</td>
<td>
<p>Item vpeB̃eLXgȑw肵܂B</p>
</td>
</tr>
<tr valign="top">
<td>
<p>Count</p>
</td>
<td>
<p>̍vڐ܂B</p>
</td>
</tr>
<tr valign="top">
<td>
<p>Item</p>
</td>
<td>
<p>̓̃f[^ڂݒ܂͎o܂B</p>
</td>
</tr>
<tr valign="top">
<td>
<p>Key</p>
</td>
<td>
<p>̃L[̖OύX܂B</p>
</td>
</tr>
</tbody>

</table>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="TITLE">Dictionary IuWFNg̃\bh</td>
</tr>
<tr>
<td colspan="2" class="description">
<p>Dictionary IuWFNǵA 5 ̃\bhT|[g܂B</p>

<table border="1">



<thead>
<tr valign="top">
<td>
<p>vpeB</p>
</td>
<td>
<p></p>
</td>
</tr>
</thead>
<tbody>
<tr valign="top">
<td>
<p>Add</p>
</td>
<td>
<p>ڂъ֘AtĂL[ɒǉ܂B</p>
</td>
</tr>
<tr valign="top">
<td>
<p>Exists</p>
</td>
<td>
<p>̃L[ɑ݂邩ǂ𒲂ׂ܂B</p>
</td>
</tr>
<tr valign="top">
<td>
<p>Keys</p>
</td>
<td>
<p>ׂ̂ẴL[Ԃ܂B</p>
</td>
</tr>
<tr valign="top">
<td>
<p>Remove</p>
</td>
<td>
<p>獀ڂ폜܂B</p>
</td>
</tr>
<tr valign="top">
<td>
<p>Remove All</p>
</td>
<td>
<p>炷ׂẴf[^폜܂B</p>
</td>
</tr>
</tbody>

</table>

</td>
</tr>
</table>
</div>
<div id="DictionaryAddMethod">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.Add \bh</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">\</td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre><var class="replaceable">dictionaryobject</var>.Add <var class="replaceable">key</var>, <var class="replaceable">item</var></pre></span>

<dl>
<dt><var class="replaceable">dictionaryobject</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :Dictionary IuWFNg</p>

<p>Dictionary IuWFNgւ̎QƁB</p>

</dd>
<dt><var class="replaceable">key</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :C</p>

<p>Dictionary IuWFNgŗL̃L[lB</p>

</dd>
<dt><var class="replaceable">item</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :C</p>

<p>ɒǉ鍀ځB</p>
</dd>

</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>L[ъ֘AtĂ鍀ڂAw肳ꂽ Dictionary IuWFNgɒǉ܂B</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>̃L[ŗLłȂꍇA^CG[ 457 "This key is already associated with an element of this collection" ܂B
</p>
</li><li>
<p><var class="replaceable">item</var> ́AIuWFNgƑ Dictionary IuWFNg܂߂āACӂ̃f[^^CvƂ邱Ƃł܂B
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">


<p>ł́ADictionary IuWFNggpāAԂ̗ƑΉԖۑ܂B
</p>

<span class="PROGRAMLISTING"><pre>Dim StateCode, StateName
Dim StateDict
Dim Key

Set StateDict = CreateObject("Scripting.Dictionary")

StateCode = "CA"
StateName = "California"
StateDict.Add StateCode, StateName

StateCode = "NY"
StateName = "New York"
StateDict.Add StateCode, StateName

StateCode = "MI"
StateName = "Michigan"
StateDict.Add StateCode, StateName

Key = "NY"
MsgBox StateDict.Item(Key)</pre></span>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">vO~Õqg</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>Dictionary IuWFNg̃o[̏͐ɂ͒`Ă܂B܂Aʂ̃o[̈ʒu𐧌䂵ADictionary IuWFNg̈ʒuɊÂČʂ̃o[oƂ͂ł܂BȒPɐƁALqR[hł́ADictionary IuWFNǧʂ̗vf̈ʒuɊւOgp邱Ƃ͂ł܂B
</p>
</li><li>
<p>L[Ɗ֘Atꂽf[^ڂǉƁAݐp Key vpeBgpăL[ύXł܂B
</p>
</li><li>
<p>f[^e[uۑɂ Dictionary IuWFNggp܂BɁAL[lɂĈӖ̂`ŃANZXłP̃f[^ڂۑƂ́ÃIuWFNggp܂B
</p>
</li><li>
<p>Dictionary IuWFNggpĕtB[h̃f[^R[hۑ邱Ƃ͂߂܂B̑ɃNXgpƁAǂvO~OƂȂ܂BʏAR[h̃tB[hl\zɒǉăR[hۑ܂BADictionary IuWFNg̍ڂɔz蓖Ă̂́ADꂽvO~O@ł͂܂B񎫏Ɋ蓖ĂƁAžʂ̗vf͒ڕύXłȂȂ邽߂łB
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">֘A</td>
</tr>
<tr>
<td colspan="2" class="description">

<p><link linkend="ch10-38906">Dictionary.Key vpeB</link></p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryCompareModeProperty">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.CompareMode vpeB</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">f[^^Cv</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Long</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Dictionary IuWFNg̃L[r邽߂Ɏgp郂[hݒ܂͕Ԃ܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>CompareMode ́Af[^܂܂ĂȂ݂̂ɐݒł܂B
</p>
</li>
<li>
<p>CompareMode vpeBɂ́A 2 ̂ꂩ̒lwł܂B</p>

<dl>
<dt>0AoCil</dt>
<dd>
<p>ꂪݒlłBoCgƂɃL[ƕrāAv݂̂邩ǂ𒲂ׂ܂B
</p>
</dd>


<dt>1AeLXg</dt>
<dd>
<p>L[ƕ̈vŁA啶ƏʂȂrgp܂B
</p>
</dd>

</dl>
</li><li>
ɁACompareMode ̒l 2 傫邱Ƃł܂B̏ꍇArŎgp郍P[ʎq (LCID) `܂B</li>
</ul>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">vO~Õqg</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>CompareMode vpeB𖾎Iɐݒ肷Kv̂́AftHg̃oCir[hgpȂꍇ݂̂łB
</p>
</li><li>
<p>Scripting Runtime ^CvCúA鐔l̑Ɏgpł萔 (<span class="LITERAL">BinaryCompare</span>  <span class="LITERAL">TextCompare</span>) `܂B́A3 ̕@̂ꂩōsƂł܂B̃R[hXNvgɒǉāA萔`ł܂B
</p>

<span class="PROGRAMLISTING"><pre>Const BinaryCompare = 0
Const TextCompare = 1</pre></span>

<p>܂AVBScript Cuɒ`Ă铯 <span class="LITERAL">vbBinaryCompare</span>  <span class="LITERAL">vbTextCompare</span> 萔gp邱Ƃł܂B</p>

<p>ŌɁAASP vO}[́AMETADATA fBNeBugp Scripting Runtime ^CvCuɃANZXł܂BWindows Script Host XNvg쐬ꍇ́AWindows Script Host (<filename>.wsf</filename> ) t@CɎ̍s܂߂āAScripting Runtime ^CvCu̒萔ɃANZXł܂B</p>

<span class="PROGRAMLISTING"><pre>&lt;reference GUID="{420B2830-E718-11CF-893D-00A0C9054228}" /&gt;</pre></span></li>

<li>
<p>CompareMode vpeB́AIɊ̃L[ƁADictionary IuWFNg Add \bhAExists \bhAItem vpeBA܂ Key vpeB <var class="replaceable">key</var> p[^̔rő啶Əʂ邩 (<span class="LITERAL">BinaryCompare</span>) ܂͋ʂȂ (<span class="LITERAL">TextCompare</span>) ܂BftHgł́A啶Əʂ܂B
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryCountProperty">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.Count vpeB</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">f[^^Cv</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Long</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Dictionary IuWFNǵuL[/ځvyA̐ԂAǂݎpvpeBB
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>̃vpeB́A̎ۂ̍ڐԂ܂B̂߁ACount vpeBgpĎ̍ڂJԂꍇ́Â悤ȃR[hgp܂B
</p>

<span class="PROGRAMLISTING"><pre>Dim ctr
For ctr = 0 to dictionary.Count - 1
   ' do something
Next</pre></span>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryExistsMethod">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.Exists \bh</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">\</td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre><var class="replaceable">dictionaryobject</var>.Exists(<var class="replaceable">key</var>) </pre></span>

<dl>
<dt><var class="replaceable">dictionaryobject</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :Dictionary IuWFNg</p>

<p>Dictionary IuWFNgւ̎QƁB</p>

</dd>
<dt><var class="replaceable">key</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :</p>

<p>Ώۂ̃L[lB</p>
</dd>

</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">߂l</td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Boolean</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>w肳ꂽL[ Dictionary IuWFNgɂ邩ǂ𒲂ׂ܂B</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>w肳ꂽL[ Dictionary IuWFNgɑ݂ꍇ <span class="LITERAL">True</span> ԂA݂Ȃꍇ <span class="LITERAL">False</span> Ԃ܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">vO~Õqg</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>Item vpeBgpđ݂ȂL[̍ڂԂƂ邩A݂ȂL[ɐVL[蓖Ă悤ƂꍇA݂ȂL[́A󔒂̍ڂƋɎɒǉ܂Bhɂ́AExists vpeBgpāAɃL[݂邱ƂmFĂ珈p܂B
</p>
</li><li>
<p><var class="replaceable">key</var> ̃L[lƔr@́ADictionary IuWFNg CompareMode vpeB̐ݒɂĎw肳܂B
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre>If oDict.Exists(strOldKey) Then
    oDict.Key(strOldKey) = strNewKey
End If   </pre></span>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryItemProperty">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.Item vpeB</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">\</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>ڂݒ肷\͎̂ƂłB</p>

<span class="PROGRAMLISTING"><pre><var class="replaceable">dictionaryobject</var>.Item(<var class="replaceable">key</var>) = <var class="replaceable">item</var></pre></span>


<p>ڂԂ\͎̂ƂłB</p>

<span class="PROGRAMLISTING"><pre><var class="replaceable">value</var> = <var class="replaceable">dictionaryobject</var>.Item(<var class="replaceable">key</var>)</pre></span>

<dl>
<dt><var class="replaceable">dictionaryobject</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :Dictionary IuWFNg</p>

<p>Dictionary IuWFNgւ̎QƁB</p>

</dd>
<dt><var class="replaceable">key</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :</p>

<p> Dictionary IuWFNgŗL̕L[B</p>

</dd>
<dt><var class="replaceable">item</var></dt>
<dd>
<p>gp :ȗ\</p>
<p>f[^^Cv :C</p>

<p><var class="replaceable">key</var> Ɋ֘AtĂf[^B</p>
</dd>

</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">f[^^Cv</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>C</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>Dictionary IuWFNg̎w肳ꂽL[ɃNf[^ڂݒ܂͕Ԃ܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>Item vpeB́ADictionary IuWFNg̃ftHgo[łB</p>
</li><li>
<p>f[^^Cv́AԂ鍀ڂ̃f[^^CvłB</p>
</li><li>
<p>قƂǂ̃IuWFNg Item vpeBƂ͈قȂADictionary IuWFNg Item vpeB͓ǂݏ\łB݂ȂL[ <var class="replaceable">item</var> ݒ肵悤ƂƁAɃL[ǉAڂ "ÖٓIȒǉ" ̂悤ɎɃN܂B
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">vO~Õqg</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>Dictionary IuWFNggpĂAʂɍڂoƂ͂ł܂B
</p>
</li><li>
<p>ڂoƂƂɑ݂ȂL[w肷ƁA͐ɓ삵ȂȂ܂B<var class="replaceable">key</var> Ƌɋ󔒂̍ڂ Dictionary IuWFNgɒǉ܂B̂߁Â̗悤ɁAڂݒ܂͕ԂOɁAExists \bhgpKv܂B
</p>
</li><li>
<p>Dictionary IuWFNgɊ蓖Ă鍀ڂ܂͎oڂ̂̂IuWFNgłꍇ́Aϐ܂ Dictionary IuWFNgɊ蓖ĂƂɁAK <span class="LITERAL">Set</span> L[[hgp܂B
</p>
</li><li>
<p><var class="replaceable">key</var> ƃo[L[̔ŕADictionary IuWFNg CompareMode vpeB̒lɂĒ`܂B
</p>
</li><li>
<p>Dictionary IuWFNg Item vpeB̓ǂݏ\ɂ͌_܂A_܂B̓Iɂ́A Item vpeB͓ǂݏ\ł邽߂ɁÃf[^ڂ㏑܂͒û͊ȒPɂȂ܂B̃vpeBƓ悤ɁAVl蓖Ă邾łB
</p>
</li><li>
<p>HTML tH[ۑ܂ ASP AvP[V Session XR[vŃf[^NG[邽߂ɁADictionary IuWFNg͌ĎgpȂłBDictionary IuWFNg̓Ap[ggXbh COM IuWFNgł邽߁AAvP[VP̎sXbhɃbN_EĂ܂܂B
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">


<p>̗ł́A[U[͂ԃR[hɑΉԖo߂̎Qƃe[uƂ Dictionary IuWFNggp܂BT[o[Ƀ[U[𑗐M HTML y[Ŵ͎ƂłB
</p>

<span class="PROGRAMLISTING"><pre>&lt;HTML&gt;
&lt;HEAD&gt;&lt;TITLE&gt;Dictionary Object Example&lt;/TITLE&gt;&lt;/HEAD&gt;
&lt;BODY&gt;
Enter your name and location: &lt;P&gt;
&lt;FORM METHOD=POST ACTION=dictobj.asp&gt;
Your name:
&lt;INPUT TYPE="Text" NAME="VisitorName" /&gt;&lt;P&gt;
Your location:
&lt;INPUT TYPE="Text" NAME="City" /&gt;,
&lt;INPUT TYPE="Text" NAME="State" SIZE=2 /&gt; &lt;P&gt;
&lt;INPUT TYPE="Submit" VALUE="Submit" /&gt;
&lt;/FORM&gt;
&lt;BODY&gt;
&lt;/HTML&gt;</pre></span>


<p>[U[ɂđMꂽoAGR[hADictionary IuWFNggpĊSȏԖo ASP y[WɎ܂B
</p>

<span class="PROGRAMLISTING"><pre>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;ASP Page for the Dictionary Object Example&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;

            &lt;% Show Greeting %&gt;

&lt;SCRIPT LANGUAGE="VBScript" RUNAT="Server"&gt;

Sub ShowGreeting(  )
   Dim StateDict
   Dim ClientName, ClientState

   ' Initialize dictionary
Set StateDict = Server.CreateObject("Scripting.Dictionary")
StateDict.Add "NY", "New York"
StateDict.Add "CA", "California"
StateDict.Add "FL", "Florida"
StateDict.Add "WA", "Washington"
StateDict.Add "MI", "Michigan"
StateDict.Add "MA", "Massachusetts"
StateDict.Add "MN", "Minnesota"
' add other states

ClientName = Server.HTMLEncode(Request.Form("VisitorName"))
ClientState = Server.HTMLEncode(Request.Form("State"))

Response.Write("Hello, " &amp; ClientName &amp; ". &lt;P&gt;")
Response.Write("We are pleased to have a visitor from ")
   Response.Write(StateDict.Item(ClientState) &amp; "!")
End Sub
&lt;/SCRIPT&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;</pre></span>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryItemsMethod">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.Items \bh</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">\</td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre><var class="replaceable">dictionaryobject</var>.Items</pre></span>

<dl>
<dt><var class="replaceable">dictionaryobject</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :Dictionary IuWFNg</p>

<p>Dictionary IuWFNgւ̎QƁB</p>
</dd>

</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">߂l</td>
</tr>
<tr>
<td colspan="2" class="description">

<p>oAgzB</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>w肳ꂽ Dictionary IuWFNĝׂĂ̍ڂ܂܂ꂽzԂ܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Ԃz͏Ƀ[x[X̃oAgzƂȂÃf[^^Cv Dictionary IuWFNg̍ڂɈv܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">vO~Õqg</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>Dictionary ̃o[ɒڃANZXɂ́AL[lgp̂B̕@łBAItems \bhgpāADictionary [x[X̃oAgzɃf[^_vł܂BŁÃR[hɎ悤ɁAf[^ڂ͒ʏ̕@Ŕẑ悤ɃANZXł悤ɂȂ܂B
</p>

<span class="PROGRAMLISTING"><pre>Dim vArray
vArray = DictObj.Items
For i = 0 to DictObj.Count -1
    Response.Write vArray(i) &amp; "&lt;P&gt;"
Next I</pre></span>
</li><li>
<p>Items \bh Dictionary IuWFNgɊi[Ă鍀ڂ݂̂o܂BׂĂ Dictionary IuWFNg̃L[́A Keys \bhĂяoĎoƂł܂B
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">֘A</td>
</tr>
<tr>
<td colspan="2" class="description">

<p><link linkend="ch10-11583">Dictionary.Keys \bh</link></p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryKeyProperty">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.Key vpeB</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">\</td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre><var class="replaceable">dictionaryobject</var>.Key(<var class="replaceable">key</var>) = <var class="replaceable">newkey</var></pre></span>

<dl>
<dt><var class="replaceable">dictionaryobject</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :Dictionary IuWFNg</p>

<p>Dictionary IuWFNgւ̎QƁB</p>

</dd>
<dt><var class="replaceable">key</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :</p>

<p>̎ڂ̃L[B</p>

</dd>
<dt><var class="replaceable">newkey</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :</p>

<p>̎ڂ̐VŗL̃L[B</p>
</dd>

</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">f[^^Cv</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>B</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>̃L[VL[Œu܂B</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>Key vpeB͏ݐpłB</p>
</li><li>
<p>̃L[l <var class="replaceable">key</var> ɑ݂ĂKv܂BłȂꍇ̓G[܂B
</p>
</li><li>
<p><var class="replaceable">newkey</var> ͌ŗLŁAɊɑ݂ĂȂKv܂BłȂꍇ̓G[܂B
</p>
</li><li>
<p><var class="replaceable">key</var>  <var class="replaceable">newkey</var> Ɗ̃L[lƂ̔ŕADictionary IuWFNg CompareMode vpeBɂĒ`܂B
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre>Private Function ChangeKeyValue(sOldKey, sNewKey)
'Assumes oDictionary is a public object
    If oDictionary.Exists(sOldKey) Then
        oDictionary.Key(sOldKey) = sNewKey
        ChangeKeyValue = True
    Else
        ChangeKeyValue = False
    End If
End Function</pre></span>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">vO~Õqg</td>
</tr>
<tr>
<td colspan="2" class="description">

<ul><li>
<p>̃L[̖OύXɂ́AKey vpeBgp܂BVL[ǉA֘AtĂl Dictionary IuWFNgɒǉɂ́AAdd \bhgp܂BׂẴL[̖Ooɂ́AKeys \bhgp܂B́AO܂͎̃RecOɕȂꍇɓɖ𗧂܂B
</p>
</li><li>
<p>L[oƂƃG[܂B悤ɁAɎɒǉĂȂL[ύX悤ƂƃG[܂BL[oƂ邱Ƃ́AL[o߂ɃL[w肷邱ƂɂȂAӖ̂ȂłB
</p>
</li><li>
<p><span class="LITERAL">For Each...Next</span> [vgp Dictionary IuWFNg̃o[JԂƁAKey vpeBÖٓIɌĂяo܂B܂A[vJԂтɁAf[^ڂł͂ȂL[Ԃ܂Bo[̃f[^oɂ́Aɂ̃L[lgpāAItem vpeBʂăf[^ɃANZXKv܂BɂẮADictionary.Item vpeB̗Ŏ܂B
</p>
</li></ul>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryKeysMethod">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.Keys \bh</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">\</td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre><var class="replaceable">dictionaryobject</var>.Keys</pre></span>

<dl>
<dt><var class="replaceable">dictionaryobject</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :Dictionary IuWFNg</p>

<p>Dictionary IuWFNgւ̎QƁB</p>
</dd>

</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">߂l</td>
</tr>
<tr>
<td colspan="2" class="description">

<p>̔z</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>w肳ꂽ Dictionary IuWFNĝׂĂ Key l܂܂ꂽzԂ܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>ԂźA 0 x[X̃oAgzƂȂÃf[^^Cv String łB
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">vO~Õqg</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>Keys \bh́ADictionary IuWFNgɕۑĂL[݂̂o܂BDictionary IuWFNĝׂĂ̍ڂ́A Items \bhĂяoĎoƂł܂BDictionary IuWFNg Item vpeBgpƁAʂ̃f[^ڂƂł܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre>Dim vArray
vArray = DictObj.Keys
For i = 0 to DictObj.Count -1
    Response.Write vArray(i) &amp; "&lt;BR&gt;"
Next</pre></span>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryRemoveMethod">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.Remove \bh</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">\</td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre><var class="replaceable">dictionaryobject</var>.Remove <var class="replaceable">key</var></pre></span>

<dl>
<dt><var class="replaceable">dictionaryobject</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :Dictionary IuWFNg</p>

<p>Dictionary IuWFNgւ̎QƁB</p>

</dd>
<dt><var class="replaceable">key</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :</p>

<p>폜鍀ڂɊ֘AtĂL[B</p>
</dd>

</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>w肳ꂽL[Ɗ֘AtĂf[^ () 폜܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">ڂł킩K</td>
</tr>
<tr>
<td colspan="2" class="description">


<p><var class="replaceable">key</var> ݂ȂꍇA^CG[ 32811 "Element not found" ܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
<div id="DictionaryRemoveAllMethod">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr valign="top">
<td class="NAME">
Dictionary.RemoveAll \bh</td>
<td class="COMPATIBILITY">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
</tr>
<tr>
<td class="usage" colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">\</td>
</tr>
<tr>
<td colspan="2" class="description">

<span class="PROGRAMLISTING"><pre><var class="replaceable">dictionaryobject</var>.RemoveAll</pre></span>

<dl>
<dt><var class="replaceable">dictionaryobject</var></dt>
<dd>
<p>gp :K{</p>
<p>f[^^Cv :Dictionary IuWFNg</p>

<p>Dictionary IuWFNgւ̎QƁB</p>
</dd>

</dl>
</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE"></td>
</tr>
<tr>
<td colspan="2" class="description">

<p>NA܂B܂AׂẴL[Ɗ֘AtĂf[^폜܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="DESCRIPTIONTITLE">vO~Õqg</td>
</tr>
<tr>
<td colspan="2" class="description">


<p>̃RecŜł͂ȂAIꂽ̃o[폜ꍇ́ARemove \bhgp܂B
</p>

</td>
</tr>
<tr>
<td colspan="2" class="CLEARSEPARATION">&nbsp;</td>
</tr>
</table>
</div>
</body>
</html>
