Results 1 to 3 of 3

Thread: How to check if a string array has been initialized **SOLVED**

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    How to check if a string array has been initialized **SOLVED**

    Hey all, this seems to be easy but I cant seem to figure out how to check if a string array has already been initialized?

    If I have public string [] attachments; defined in my class.

    No I want to check if the array has got any values in it, but if I do,

    if (attachments.Length !=0)

    I get an error saying:
    Object reference not set to an instance of an object.

    So how do I check if my array has already been initialized or not?

    Thanks Stephan
    Last edited by Sgt-Peppa; Jun 2nd, 2004 at 08:00 AM.
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

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