use of unassigned variables

  • (2 Pages)
  • +
  • 1
  • 2

24 Replies - 733 Views - Last Post: 22 September 2013 - 01:03 PM Rate Topic: -----

#16 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: use of unassigned variables

Posted 22 September 2013 - 12:25 PM

crseDaysRegistrationFeeListBox.SelectedItem.ToString()


or

(crseDaysRegistrationFeeListBox.SelectedItem.ToString()


is not a string that can be converted into a valid integer.

Try moving that code out and put it in a temp variable before parsing it.

string temp = (crseDaysRegistrationFeeListBox.SelectedItem.ToString()


When you pass through it with the debugger you can then see exactly what value it has and why it can't be converted to an int.
Was This Post Helpful? 0
  • +
  • -

#17 RoxanneBillings  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 19-March 11

Re: use of unassigned variables

Posted 22 September 2013 - 12:27 PM

Where does it show me the line of code in error because so far it just pops up a box with the error and takes me back to the code when I exit the pop up?


View Postandrewsw, on 22 September 2013 - 12:24 PM, said:

When you get the error what line (in your posted code) does it take you to?

Was This Post Helpful? 0
  • +
  • -

#18 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: use of unassigned variables

Posted 22 September 2013 - 12:27 PM

When the box pops up it normally has a line that points to the line of code it came from. Try moving the box around a bit when it shows and see if you can see the black line.

This post has been edited by Ryano121: 22 September 2013 - 12:28 PM

Was This Post Helpful? 0
  • +
  • -

#19 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3488
  • View blog
  • Posts: 11,902
  • Joined: 12-December 12

Re: use of unassigned variables

Posted 22 September 2013 - 12:28 PM

When you press the Break button it takes you to a line in the code; which line?
Was This Post Helpful? 0
  • +
  • -

#20 RoxanneBillings  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 19-March 11

Re: use of unassigned variables

Posted 22 September 2013 - 12:33 PM

I so do not understand the entire debugger yet; when I click "step into" it takes me to another tab called program.cs that says this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Assignment_3_Training_Selector
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new trainingSelector());
        }
    }
}



BUT . . . I do not understand what this means . . .Wow I feel really stupid right now!
Was This Post Helpful? 0
  • +
  • -

#21 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: use of unassigned variables

Posted 22 September 2013 - 12:35 PM

Where have you set your breakpoint?
Was This Post Helpful? 0
  • +
  • -

#22 RoxanneBillings  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 19-March 11

Re: use of unassigned variables

Posted 22 September 2013 - 12:36 PM

I do not understand what you mean by breakpoint - sorry.


View PostRyano121, on 22 September 2013 - 12:35 PM, said:

Where have you set your breakpoint?

Was This Post Helpful? 0
  • +
  • -

#23 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: use of unassigned variables

Posted 22 September 2013 - 12:38 PM

Did you read all of the tutorial?

Debugging
Was This Post Helpful? 0
  • +
  • -

#24 RoxanneBillings  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 19-March 11

Re: use of unassigned variables

Posted 22 September 2013 - 12:41 PM

I will read it again; probably missed something. Will post with any questions; thank you so much for the guidance.


View PostRyano121, on 22 September 2013 - 12:38 PM, said:

Did you read all of the tutorial?

Debugging

Was This Post Helpful? 0
  • +
  • -

#25 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3488
  • View blog
  • Posts: 11,902
  • Joined: 12-December 12

Re: use of unassigned variables

Posted 22 September 2013 - 01:03 PM

@OP You don't have to keep quoting the previous post, there is a large Reply button a little further down.

(It's not a problem ;) just letting you know.)

This post has been edited by andrewsw: 22 September 2013 - 02:12 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2