Results 1 to 2 of 2

Thread: [RESOLVED] Object Reference not set to an...

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Resolved [RESOLVED] Object Reference not set to an...

    Object Reference Not Set To An Instance Of An Object

    Code:
    private void SetAudioList()
            {
                audioList = rtbOrder.Lines;
                for (int i = 0; i < audioList.Length; i++)
                {
                    audioRefList[i] = (Application.StartupPath + @"\AudioFiles\" + audioList[i]);
                }
            }
    The line, audioRefList[i] = ....., is the one where the error appears on. audioRefList and audioList are both string[]'s that are declared at the top of the class. rtbOrder is a richtextbox.


    EDIT
    I solved the problem by adding this line of code:
    Code:
    audioRefList = new string[rtbOrder.Lines.Length - 1];
    The reason i didnt set the array in the first place is because i thought i didn't have the ammount of items it was going to contain.
    Last edited by noahssite; Jul 3rd, 2009 at 08:46 PM.

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