Results 1 to 3 of 3

Thread: A question about arrays

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2004
    Location
    Kirkland, WA
    Posts
    7

    A question about arrays

    VB.NET

    This statement compiles just fine:

    Dim NumbersList() As Integer = (12, 32, -3, 114, 543)

    But this one will not:

    Dim StringsList() As String = ("make", "it", "work", "please")

    I get a ')' expected at the first comma, any ideas why?

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Post your question in the .Net Forum here.

  3. #3
    Hyperactive Member
    Join Date
    May 2003
    Posts
    401

    Re: A question about arrays

    Originally posted by ZoomyX
    VB.NET

    This statement compiles just fine:

    Dim NumbersList() As Integer = (12, 32, -3, 114, 543)

    But this one will not:

    Dim StringsList() As String = ("make", "it", "work", "please")

    I get a ')' expected at the first comma, any ideas why?
    try this:

    Dim StringsList() As String = {"make", "it", "work", "please"}

    Changed the ordinary braces to curly braces.
    Enjoy!!!
    apps_tech

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width