Home All Groups Group Topic Archive Search About

Conversion from System.Array to a Collection

Author
12 Mar 2006 12:54 PM
Bernard_Bourée
Hello

I have an external API who provide a function returning an System.Array.

I'm trying to convert it in a ArrayList or an other collection but could
not succeed.

Dim SA as System.Array

SA = MyFunction API() 'which return the System.Array

The conversion

Dim Col as ArrayList
Col = DirectCast( SA, ArrayList)

Does not work.

Thanks for your help.

Bernard

Author
12 Mar 2006 12:59 PM
Herfried K. Wagner [MVP]
"Bernard Bourée" <bern***@bouree.net> schrieb:
> I have an external API who provide a function returning an System.Array.
>
> I'm trying to convert it in a ArrayList or an other collection but could
> not succeed.

\\\
Dim array() As String = ...
Dim al As New ArrayList(array)
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
12 Mar 2006 4:04 PM
Bernard_Bourée
Herfried K. Wagner [MVP] a écrit :
Show quoteHide quote
> "Bernard Bourée" <bern***@bouree.net> schrieb:
>> I have an external API who provide a function returning an System.Array.
>>
>> I'm trying to convert it in a ArrayList or an other collection but
>> could not succeed.
>
> \\\
> Dim array() As String = ...
> Dim al As New ArrayList(array)
> ///
>
Thanks