View Single Post
  #3 (permalink)  
Old February 4th, 2004, 07:27 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

As soon as return is found in a method (in this case, the Get accessor for the InvoiceFullName property), the return value is returned, and execution of the method stops:
Code:
get
{
  return istrFullName;
  // THIS IS TELLING ME UNREACHABLE CODE
  Console.WriteLine(istrFullName);
}
As you can see, the Console.WriteLine call occurs after the return statement and is therefore unreachable. Swap the two statements and you should be fine:
Code:
get
{
  Console.WriteLine(istrFullName);
  return istrFullName;
}
Not sure about the other problems you're having though. Can you elaborate a bit?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote