Click here to Skip to main content
15,921,542 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Be safe Frenchies Pin
Patrice T14-Nov-15 2:05
mvePatrice T14-Nov-15 2:05 
GeneralRe: Be safe Frenchies Pin
Eytukan14-Nov-15 1:30
Eytukan14-Nov-15 1:30 
GeneralRe: Be safe Frenchies Pin
Patrice T14-Nov-15 2:06
mvePatrice T14-Nov-15 2:06 
GeneralRubik's cube... Pin
Sander Rossel13-Nov-15 12:06
professionalSander Rossel13-Nov-15 12:06 
GeneralRe: Rubik's cube... Pin
Patrice T13-Nov-15 12:26
mvePatrice T13-Nov-15 12:26 
GeneralRe: Rubik's cube... Pin
Gary R. Wheeler13-Nov-15 14:43
Gary R. Wheeler13-Nov-15 14:43 
GeneralRe: Rubik's cube... Pin
Patrice T13-Nov-15 14:50
mvePatrice T13-Nov-15 14:50 
GeneralBug of the Day Pin
Chris Maunder13-Nov-15 8:50
cofounderChris Maunder13-Nov-15 8:50 
I didn't actually think this was possible:
C#
class MyClass
{
   OtherClass _otherClass;
   ...

   public Populate()
   {
      OtherClass _otherClass = new OtherClass(); 

      ...
      // do lots of stuff and Populate _otherClass with stacks of data
      ...
   }

   public void Process()
   {
       if (_otherClass.HasNoData)
           TotallyFreakOut();
   }
}

var thing = new MyClass();
thing.Populate();
thing.Process();

The gist is that I have a class with a member variable _otherClass. I initialise and fill that _otherClass with stuff in one method, then access and process _otherClass in another. The problem was that in the other method I was finding _otherClass empty, even though I'd traced line by line watching data be assigned to _otherClass.

I honestly thought the compiler would catch that - but evidently not! Live and learn.
cheers
Chris Maunder

GeneralRe: Bug of the Day Pin
R. Giskard Reventlov13-Nov-15 8:56
R. Giskard Reventlov13-Nov-15 8:56 
GeneralRe: Bug of the Day Pin
Afzaal Ahmad Zeeshan13-Nov-15 9:03
professionalAfzaal Ahmad Zeeshan13-Nov-15 9:03 
GeneralRe: Bug of the Day Pin
Ravi Bhavnani13-Nov-15 9:17
professionalRavi Bhavnani13-Nov-15 9:17 
GeneralRe: Bug of the Day Pin
  Forogar  13-Nov-15 9:19
professional  Forogar  13-Nov-15 9:19 
GeneralRe: Bug of the Day Pin
Sander Rossel13-Nov-15 12:01
professionalSander Rossel13-Nov-15 12:01 
GeneralRe: Bug of the Day Pin
Kevin Marois13-Nov-15 12:56
professionalKevin Marois13-Nov-15 12:56 
GeneralRe: Bug of the Day Pin
Gary R. Wheeler13-Nov-15 14:46
Gary R. Wheeler13-Nov-15 14:46 
GeneralRe: Bug of the Day Pin
Chris Maunder14-Nov-15 1:45
cofounderChris Maunder14-Nov-15 1:45 
GeneralRe: Bug of the Day Pin
John Torjo13-Nov-15 14:56
professionalJohn Torjo13-Nov-15 14:56 
GeneralRe: Bug of the Day Pin
Eytukan14-Nov-15 1:28
Eytukan14-Nov-15 1:28 
GeneralRe: Bug of the Day Pin
Chris Maunder14-Nov-15 16:15
cofounderChris Maunder14-Nov-15 16:15 
GeneralRe: Bug of the Day Pin
Eytukan14-Nov-15 20:38
Eytukan14-Nov-15 20:38 
RantIS (InstallShield) Pin
User 1106097913-Nov-15 8:35
User 1106097913-Nov-15 8:35 
GeneralRe: IS (InstallShield) Pin
Afzaal Ahmad Zeeshan13-Nov-15 8:46
professionalAfzaal Ahmad Zeeshan13-Nov-15 8:46 
GeneralRe: IS (InstallShield) Pin
User 1106097913-Nov-15 8:51
User 1106097913-Nov-15 8:51 
GeneralRe: IS (InstallShield) Pin
Dave Kreskowiak13-Nov-15 9:35
mveDave Kreskowiak13-Nov-15 9:35 
GeneralRe: IS (InstallShield) Pin
User 1106097913-Nov-15 9:59
User 1106097913-Nov-15 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.