<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Powershell: How to Dimension an Array</title>
	<atom:link href="http://halr9000.com/article/430/feed" rel="self" type="application/rss+xml" />
	<link>http://halr9000.com/article/430</link>
	<description>(powershell &#38; other stuff)</description>
	<lastBuildDate>Thu, 17 May 2012 06:21:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Stupid Array Tricks: Initializing an Array to a Certain Size &#124; keyongtech</title>
		<link>http://halr9000.com/article/430/comment-page-1#comment-7002</link>
		<dc:creator>Stupid Array Tricks: Initializing an Array to a Certain Size &#124; keyongtech</dc:creator>
		<pubDate>Sun, 18 Jan 2009 16:52:36 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/430#comment-7002</guid>
		<description>[...] Then Bruce Payette followed up with more info which was awesome, so click the link to see that.  http://halr9000.com/article/430  method 1:  $array = ,0 * 20  method 2:  $array = @(0) * 20  -- Author, Tech Prosaic blog [...]</description>
		<content:encoded><![CDATA[<p>[...] Then Bruce Payette followed up with more info which was awesome, so click the link to see that.  <a href="http://halr9000.com/article/430" rel="nofollow">http://halr9000.com/article/430</a>  method 1:  $array = ,0 * 20  method 2:  $array = @(0) * 20  &#8212; Author, Tech Prosaic blog [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: /\/\o\/\/</title>
		<link>http://halr9000.com/article/430/comment-page-1#comment-5941</link>
		<dc:creator>/\/\o\/\/</dc:creator>
		<pubDate>Fri, 14 Sep 2007 11:57:32 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/430#comment-5941</guid>
		<description>An other option using a static method of the Array class :

PoSH&gt; [array]::CreateInstance([object],5)
PoSH&gt; $a = [array]::CreateInstance([int],5)
PoSH&gt; $a
0
0
0
0
0
PoSH&gt; $a[2] = &#039;foo&#039;
Array assignment to [2] failed: Cannot convert value &quot;foo&quot; to type &quot;System.Int
rror: &quot;Input string was not in a correct format.&quot;.

Greetings /\/\o\/\/</description>
		<content:encoded><![CDATA[<p>An other option using a static method of the Array class :</p>
<p>PoSH&gt; [array]::CreateInstance([object],5)<br />
PoSH&gt; $a = [array]::CreateInstance([int],5)<br />
PoSH&gt; $a<br />
0<br />
0<br />
0<br />
0<br />
0<br />
PoSH&gt; $a[2] = &#8216;foo&#8217;<br />
Array assignment to [2] failed: Cannot convert value &#8220;foo&#8221; to type &#8220;System.Int<br />
rror: &#8220;Input string was not in a correct format.&#8221;.</p>
<p>Greetings /\/\o\/\/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: halr9000</title>
		<link>http://halr9000.com/article/430/comment-page-1#comment-5878</link>
		<dc:creator>halr9000</dc:creator>
		<pubDate>Thu, 13 Sep 2007 11:03:14 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/430#comment-5878</guid>
		<description>Ahh, very good.  I just reviewed the help file for new-object and I have to say this usage is not extremely obvious.  Guess that&#039;s why we have books like &quot;Powershell in Action&quot;.  ;)</description>
		<content:encoded><![CDATA[<p>Ahh, very good.  I just reviewed the help file for new-object and I have to say this usage is not extremely obvious.  Guess that&#8217;s why we have books like &#8220;Powershell in Action&#8221;.  <img src='http://halr9000.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Payette</title>
		<link>http://halr9000.com/article/430/comment-page-1#comment-5863</link>
		<dc:creator>Bruce Payette</dc:creator>
		<pubDate>Wed, 12 Sep 2007 18:20:52 +0000</pubDate>
		<guid isPermaLink="false">http://halr9000.com/article/430#comment-5863</guid>
		<description>@(123) * 100 works and it has the upside of initializing the collection to a specific value, however if you just want to allocate space, you can do this efficiently with the New-Object cmdlet:

PS (52) &gt; $a = new-object object[] 10
PS (53) &gt; $a.count
10
PS (54) &gt; $a = new-object int[] 30
PS (55) &gt; $a.count
30

-bruce [MSFT]</description>
		<content:encoded><![CDATA[<p>@(123) * 100 works and it has the upside of initializing the collection to a specific value, however if you just want to allocate space, you can do this efficiently with the New-Object cmdlet:</p>
<p>PS (52) &gt; $a = new-object object[] 10<br />
PS (53) &gt; $a.count<br />
10<br />
PS (54) &gt; $a = new-object int[] 30<br />
PS (55) &gt; $a.count<br />
30</p>
<p>-bruce [MSFT]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

