468,727 Members | 1,467 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,727 developers. It's quick & easy.

Use CType to Convert Array

Structure myXMLtype
Dim Filename As String
Dim sql As String
End Structure
....

Dim obj as New ArrayList
......

return CType(obj.ToArray, myXMLtype) 'This wont work

I know that CType() can't be used to convert a Array into a array of another type but is there any other method that will to do this
without having to create another array, and then do a loop where you convert each element?

Nov 20 '05 #1
2 4116
Hi,

Take a look at the arraylist's copyto method.
http://msdn.microsoft.com/library/de...opytotopic.asp

Ken
----------------------
"Jarod_24" <ja******@hotmail.com> wrote in message
news:f4******************************@news.teranew s.com...
Structure myXMLtype
Dim Filename As String
Dim sql As String
End Structure
...

Dim obj as New ArrayList
.....

return CType(obj.ToArray, myXMLtype) 'This wont work

I know that CType() can't be used to convert a Array into a array of another type but is there any other method that will to do this without having to create another array, and then do a loop where you convert each element?

Nov 20 '05 #2
Hi,

Take a look at the arraylist's copyto method.
http://msdn.microsoft.com/library/de...opytotopic.asp

Ken
----------------------
"Jarod_24" <ja******@hotmail.com> wrote in message
news:f4******************************@news.teranew s.com...
Structure myXMLtype
Dim Filename As String
Dim sql As String
End Structure
...

Dim obj as New ArrayList
.....

return CType(obj.ToArray, myXMLtype) 'This wont work

I know that CType() can't be used to convert a Array into a array of another type but is there any other method that will to do this without having to create another array, and then do a loop where you convert each element?

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Joeri | last post: by
1 post views Thread by Logan X via .NET 247 | last post: by
8 posts views Thread by John A Grandy | last post: by
reply views Thread by Jarod_24 | last post: by
7 posts views Thread by Brian Henry | last post: by
8 posts views Thread by =?Utf-8?B?d2lubGlu?= | last post: by
9 posts views Thread by bryonone | last post: by
xarzu
1 post views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.