![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | newb question - iteratate a hashtable Looks like I am one of the first here... I have an associative array, created with $xsize = @{} I want to iterate the array, printing the results. I need to add a little formatting to it. "somestatictext KEY morestatictext VALUE I assume it is somesort of foreach, but i don't know what to use for the properties. Any help? |
My System Specs![]() |
| | #2 (permalink) |
| | Re: newb question - iteratate a hashtable "Jeff Jarrell" <jjarrel_NOSPAM@yahoo.com> wrote in message news:%23E$qp4ueGHA.4828@TK2MSFTNGP05.phx.gbl... > Looks like I am one of the first here... > > I have an associative array, created with > $xsize = @{} > > I want to iterate the array, printing the results. I need to add a little > formatting to it. > "somestatictext KEY morestatictext VALUE > > I assume it is somesort of foreach, but i don't know what to use for the > properties. Well you can use the built-in formatting: PS> $xsize .... or you can do this: PS> foreach ($key in $xsize.keys) {$key}; foreach ($val in $xsize.values) {$val} -- Keith |
My System Specs![]() |
| | #3 (permalink) |
| | RE: newb question - iteratate a hashtable PS 46> foreach ( $b in $x.keys ) { "the key is $b,the value is $($x.$b) `n" } the key is foo,the value is bar the key is apple,the value is me PS 47> $x Name Value ---- ----- foo bar apple me -- greeting applepwc "Jeff Jarrell" wrote: > Looks like I am one of the first here... > > I have an associative array, created with > $xsize = @{} > > I want to iterate the array, printing the results. I need to add a little > formatting to it. > "somestatictext KEY morestatictext VALUE > > I assume it is somesort of foreach, but i don't know what to use for the > properties. > > Any help? > > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: newb question - iteratate a hashtable now, thats what I am talking about. thanks. jeff "Keith Hill [MVP]" <r_keith_hill@no.spam.thank.u.hotmail.com> wrote in message news:OB2M2zveGHA.3484@TK2MSFTNGP02.phx.gbl... > "Jeff Jarrell" <jjarrel_NOSPAM@yahoo.com> wrote in message > news:%23E$qp4ueGHA.4828@TK2MSFTNGP05.phx.gbl... >> Looks like I am one of the first here... >> >> I have an associative array, created with >> $xsize = @{} >> >> I want to iterate the array, printing the results. I need to add a >> little formatting to it. >> "somestatictext KEY morestatictext VALUE >> >> I assume it is somesort of foreach, but i don't know what to use for the >> properties. > > Well you can use the built-in formatting: > > PS> $xsize > > ... > > or you can do this: > > PS> foreach ($key in $xsize.keys) {$key}; foreach ($val in $xsize.values) > {$val} > > -- > Keith > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Probably a complete newb question | Network & Sharing | |||
| Help! IR NEWB | Gaming | |||
| complete newb | Network & Sharing | |||
| stoopid newb question | PowerShell | |||
| NewB to Vista Mail has question | Vista mail | |||