471,049 Members | 1,272 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,049 software developers and data experts.

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 4631
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.