Solved

not all code paths return a value

Posted on 2004-04-08
2
270 Views
Last Modified: 2010-04-15
hi there,

i got that "not all code paths return a value" message when i just created a method like this:

public Category getCategory(string catid)
{
}

since i haven't added any code in it, i don't understand why the complier complained about it.  can anyone give me a hint?

thank you.
0
Comment
Question by:mlcy44
2 Comments
 
LVL 12

Accepted Solution

by:
dfiala13 earned 90 total points
ID: 10785666
Yes,
It expects a variable of the type Category to be returned.  Since you haven't supplied one it gets upset.

You can stub it out this way until you add in your logic...

public Category getCategory(string catid)
{
 return new Category();
}
0
 

Author Comment

by:mlcy44
ID: 10785739
ty, i just realized that.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now