Results 1 to 2 of 2

Thread: optional and arrays

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Posts
    207

    optional and arrays

    Hi,

    I have two questions maybee someone can help me with.

    1) How can i make a parameter optional, example in vb I would do myFunc(a as string, optional b as string).

    2) How can i redelcar an array example in vb I would do this Dim myarray(4) as string then I could do redim myarray(6).

    Any help would be appreciated.

    Jeremy

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    1.) The C# Language does not support optional paramaters. You need to overload your methods in order to provide this functionality.

    2.) Check out the ArrayList() class. You do not have to explicity re-dimiension your array, the arraylist() will automatically adjust to your adding/removing of objects.

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