problem with join()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • André

    #1

    problem with join()

    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é


  • Tom Shelton

    #2
    Re: problem with join()


    André wrote:
    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.Str ingBuilder to build your string.

    --
    Tom Shelton

    Comment

    • André

      #3
      Re: problem with join()

      Thanks

      "Tom Shelton" <tom_shelton@co mcast.netschree f in bericht
      news:1164816485 .335652.257450@ 80g2000cwy.goog legroups.com...

      André wrote:
      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.Str ingBuilder to build your string.

      --
      Tom Shelton


      Comment

      Working...