Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11223
| X-Received | by 10.182.33.102 with SMTP id q6mr25303183obi.11.1453857210412; Tue, 26 Jan 2016 17:13:30 -0800 (PST) |
|---|---|
| X-Received | by 10.182.40.227 with SMTP id a3mr332022obl.14.1453857210350; Tue, 26 Jan 2016 17:13:30 -0800 (PST) |
| Path | csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!o2no6547048iga.0!news-out.google.com!l1ni8801igd.0!nntp.google.com!h5no9900632igh.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | microsoft.public.scripting.vbscript |
| Date | Tue, 26 Jan 2016 17:13:29 -0800 (PST) |
| In-Reply-To | <56a75878$0$23745$e4fe514c@news.xs4all.nl> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=202.214.244.211; posting-account=H2IpRwoAAAB363RdWTfMHis6okNiEcWg |
| NNTP-Posting-Host | 202.214.244.211 |
| References | <56a75878$0$23745$e4fe514c@news.xs4all.nl> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <2b36d537-18b8-4610-9eaa-46d13bc8fa35@googlegroups.com> (permalink) |
| Subject | Re: Return a key, value pair from a "for each" loop. |
| From | ttanaka@cybernet.co.jp |
| Injection-Date | Wed, 27 Jan 2016 01:13:30 +0000 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| X-Received-Bytes | 2142 |
| X-Received-Body-CRC | 804109286 |
| Xref | csiph.com microsoft.public.scripting.vbscript:11223 |
Show key headers only | View raw
You can use Scripting.Dictionary object:
Dim aList
Set aList = CreateObject("Scripting.Dictionary")
aList.Add "a", "123"
aList.Add "b", "456"
aList.Add "c", "789"
Dim sKey
For Each sKey In aList.Keys
Dim sValue
sValue = aList(sKey)
WScript.Echo "key : [" & sKey & "], value = [" & sValue & "]"
Next
2016年1月26日火曜日 20時29分41秒 UTC+9 R.Wieser:
> Hello all,
>
> Is there, and what is the format of, a "for each" loop which returns TWO
> results (key and its associated value) at the same time. In PHP I would
> use " foreach ($aList as $sKey => $sValue)". Is there something equivalent
> in/under VBScript ?
>
> Remark: I'm not looking for the dictionary object. I know that one. It
> does not have it either. :-)
>
> (Full disclosure: I'm implementing a IEnumVariant object)
>
> Regards,
> Rudy Wieser
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar
Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-26 12:31 +0100
Re: Return a key, value pair from a "for each" loop. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-26 12:54 +0100
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-26 14:18 +0100
Re: Return a key, value pair from a "for each" loop. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-26 14:42 +0100
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-26 15:27 +0100
Re: Return a key, value pair from a "for each" loop. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-26 17:08 +0100
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-26 18:44 +0100
Re: Return a key, value pair from a "for each" loop. "Mayayana" <mayayana@invalid.nospam> - 2016-01-26 08:26 -0500
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-26 16:41 +0100
Re: Return a key, value pair from a "for each" loop. JJ <jj4public@vfemail.net> - 2016-01-27 01:01 +0700
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-26 20:41 +0100
Re: Return a key, value pair from a "for each" loop. JJ <jj4public@vfemail.net> - 2016-01-27 16:56 +0700
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 13:16 +0100
Re: Return a key, value pair from a "for each" loop. JJ <jj4public@vfemail.net> - 2016-01-28 04:16 +0700
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-28 00:17 +0100
Re: Return a key, value pair from a "for each" loop. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-28 00:22 +0100
Re: Return a key, value pair from a "for each" loop. JJ <jj4public@vfemail.net> - 2016-01-28 16:03 +0700
Re: Return a key, value pair from a "for each" loop. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-28 11:59 +0100
Re: Return a key, value pair from a "for each" loop. GS <gs@v.invalid> - 2016-01-26 18:10 -0500
Re: Return a key, value pair from a "for each" loop. GS <gs@v.invalid> - 2016-01-26 18:12 -0500
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 11:33 +0100
Re: Return a key, value pair from a "for each" loop. GS <gs@v.invalid> - 2016-01-27 12:27 -0500
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 19:42 +0100
Re: Return a key, value pair from a "for each" loop. GS <gs@v.invalid> - 2016-01-27 14:36 -0500
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 23:34 +0100
Re: Return a key, value pair from a "for each" loop. GS <gs@v.invalid> - 2016-01-27 18:13 -0500
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-28 09:49 +0100
Re: Return a key, value pair from a "for each" loop. Ulrich Möller <knobbi38@arcor.de> - 2016-01-27 01:30 +0100
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 11:40 +0100
Re: Return a key, value pair from a "for each" loop. Ulrich Möller <knobbi38@arcor.de> - 2016-01-27 15:08 +0100
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 15:51 +0100
Re: Return a key, value pair from a "for each" loop. ttanaka@cybernet.co.jp - 2016-01-26 17:13 -0800
Re: Return a key, value pair from a "for each" loop. "Mayayana" <mayayana@invalid.nospam> - 2016-01-26 21:28 -0500
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 12:41 +0100
Re: Return a key, value pair from a "for each" loop. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-27 12:44 +0100
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 13:21 +0100
Re: Return a key, value pair from a "for each" loop. "R.Wieser" <address@not.available> - 2016-01-27 11:43 +0100
csiph-web