Home All Groups Group Topic Archive Search About
Author
29 Nov 2006 3:47 PM
André
Hi,

I have a two-dimension array with integers and i want to join it into a
string. See my code:
dim va(10,5) as integer
dim mystring as string
....
for j=1 to 10
for k=1 to 5
mystring = Join(";",va(j,k).ToString)
next
next


The error i get is: "value of type string cannot be converted to
1-dimensional array of string"

Thanks for help
André

Author
29 Nov 2006 4:08 PM
Tom Shelton
André wrote:
Show quoteHide quote
> Hi,
>
> I have a two-dimension array with integers and i want to join it into a
> string. See my code:
> dim va(10,5) as integer
> dim mystring as string
> ...
> for j=1 to 10
> for k=1 to 5
> mystring = Join(";",va(j,k).ToString)
> next
> next
>
>
> The error i get is: "value of type string cannot be converted to
> 1-dimensional array of string"
>
> Thanks for help
> André

well, thakes a string and a 1-dimensional array.  By calling .ToString
you calling it with a string and a string - not an array.  Hence your
error.

Of course, you can't call it with a 2D array anyway.  So, your probably
going to have to do this manually.  I would look at using
System.Text.StringBuilder to build your string.

--
Tom Shelton
Author
29 Nov 2006 5:05 PM
André
Thanks

"Tom Shelton" <tom_shel***@comcast.net> schreef in bericht
news:1164816485.335652.257450@80g2000cwy.googlegroups.com...

André wrote:
Show quoteHide quote
> Hi,
>
> I have a two-dimension array with integers and i want to join it into a
> string. See my code:
> dim va(10,5) as integer
> dim mystring as string
> ...
> for j=1 to 10
> for k=1 to 5
> mystring = Join(";",va(j,k).ToString)
> next
> next
>
>
> The error i get is: "value of type string cannot be converted to
> 1-dimensional array of string"
>
> Thanks for help
> André

well, thakes a string and a 1-dimensional array.  By calling .ToString
you calling it with a string and a string - not an array.  Hence your
error.

Of course, you can't call it with a 2D array anyway.  So, your probably
going to have to do this manually.  I would look at using
System.Text.StringBuilder to build your string.

--
Tom Shelton