Hi,

i want to redim a array that ot the data part of a dictionary.

dim oDic
dim aData
dim i

aData = split("abc,def,ghi",",")
set oDic = wscript.CreateObject("Scripting.Dictionary")
oDic.add "Row1", aData
i = ubound(oDic("Row1"),1) + 1
redim oDic("Row1")(i) ' <= fails



Any ideas ?

Many Thanks
Clas




--
The light at the end of the tunnel,
was switch off due to high costs.

RE: redim array in dictionary by tlavedas

tlavedas
Wed Jun 23 12:14:01 CDT 2004

aData = split("abc,def,ghi",",")
set oDic = wscript.CreateObject("Scripting.Dictionary")
oDic.add "Row1", aData
i = ubound(oDic("Row1"),1) + 1
aTemp = oDic("Row1")
oDic.Remove("Row1")
redim Preserve aTemp(i)
aTemp(i) = "xyz"
oDic.add "Row1", aTemp
atemp = Empty
wsh.echo Join(oDic("Row1"), ", ")

Tom Lavedas
===========

"Clas Hortien" wrote:

> Hi,
>
> i want to redim a array that ot the data part of a dictionary.
>
> dim oDic
> dim aData
> dim i
>
> aData = split("abc,def,ghi",",")
> set oDic = wscript.CreateObject("Scripting.Dictionary")
> oDic.add "Row1", aData
> i = ubound(oDic("Row1"),1) + 1
> redim oDic("Row1")(i) ' <= fails
>
>
>
> Any ideas ?
>
> Many Thanks
> Clas
>
>
>
>
> --
> The light at the end of the tunnel,
> was switch off due to high costs.
>

RE: redim array in dictionary by tlavedas

tlavedas
Wed Jun 23 12:16:02 CDT 2004

aData = split("abc,def,ghi",",")
set oDic = wscript.CreateObject("Scripting.Dictionary")
oDic.add "Row1", aData
i = ubound(oDic("Row1"),1) + 1
aTemp = oDic("Row1")
oDic.Remove("Row1")
redim Preserve aTemp(i)
aTemp(i) = "xyz"
oDic.add "Row1", aTemp
atemp = Empty
wsh.echo Join(oDic("Row1"), ", ")

Tom Lavedas
===========


"Clas Hortien" wrote:

> Hi,
>
> i want to redim a array that ot the data part of a dictionary.
>
> dim oDic
> dim aData
> dim i
>
> aData = split("abc,def,ghi",",")
> set oDic = wscript.CreateObject("Scripting.Dictionary")
> oDic.add "Row1", aData
> i = ubound(oDic("Row1"),1) + 1
> redim oDic("Row1")(i) ' <= fails
>
>
>
> Any ideas ?
>
> Many Thanks
> Clas
>
>
>
>
> --
> The light at the end of the tunnel,
> was switch off due to high costs.
>

Re: redim array in dictionary by Michael

Michael
Wed Jun 23 18:17:26 CDT 2004

Clas Hortien wrote:
> Hi,
>
> i want to redim a array that ot the data part of a dictionary.
>
> dim oDic
> dim aData
> dim i
>
> aData = split("abc,def,ghi",",")
> set oDic = wscript.CreateObject("Scripting.Dictionary")
> oDic.add "Row1", aData
> i = ubound(oDic("Row1"),1) + 1
> redim oDic("Row1")(i) ' <= fails
>
>
>
> Any ideas ?


dim oDic
dim aData
dim i

aData = split("abc,def,ghi",",")
set oDic = wscript.CreateObject("Scripting.Dictionary")
oDic.add "Row1", aData
'.
'..
'... other code ...
'..
'.
dim aTemp
aTemp = oDic("Row1")
i = ubound(aTemp,1) + 1
ReDim Preserve aTemp(i)
oDic("Row1") = aTemp


--
Michael Harris
Microsoft.MVP.Scripting
Sammamish WA US

Re: redim array in dictionary by Clas

Clas
Thu Jun 24 02:37:55 CDT 2004

"Michael Harris \(MVP\)" wrote :

> dim oDic
> dim aData
> dim i
>
> aData = split("abc,def,ghi",",")
> set oDic = wscript.CreateObject("Scripting.Dictionary")
> oDic.add "Row1", aData
> '.
> '..
> '... other code ...
> '..
> '.
> dim aTemp
> aTemp = oDic("Row1")
> i = ubound(aTemp,1) + 1
> ReDim Preserve aTemp(i)
> oDic("Row1") = aTemp


Thanks a lot, that helped me out.

Regards

Clas

--
The light at the end of the tunnel,
was switch off due to high costs.