Click here to Skip to main content
15,884,177 members
Home / Discussions / C#
   

C#

 
GeneralRe: customizing a ToolStripTextBox Pin
DaveyM6914-Jul-09 6:26
professionalDaveyM6914-Jul-09 6:26 
Questionreturn string Pin
AndyInUK14-Jul-09 5:22
AndyInUK14-Jul-09 5:22 
AnswerRe: return string Pin
Simon P Stevens14-Jul-09 5:28
Simon P Stevens14-Jul-09 5:28 
GeneralRe: return string Pin
AndyInUK14-Jul-09 5:36
AndyInUK14-Jul-09 5:36 
AnswerRe: return string PinPopular
Luc Pattyn14-Jul-09 5:42
sitebuilderLuc Pattyn14-Jul-09 5:42 
GeneralRe: return string Pin
AndyInUK14-Jul-09 6:19
AndyInUK14-Jul-09 6:19 
GeneralRe: return string Pin
Luc Pattyn14-Jul-09 6:27
sitebuilderLuc Pattyn14-Jul-09 6:27 
GeneralRe: return string Pin
musefan14-Jul-09 7:10
musefan14-Jul-09 7:10 
AndyInUK wrote:
You learn more when you do stuff rather than reading it.


So why use CodeProject? Do you not think you will have to read what people post in response to your questions.

Also, it is not always the case you learn stuff more by doing it. Your original post said you has trouble with using a value which was not declared in scope (scope being a word you must have learnt somewhere) - no matter how many times you right the same code, it wont suddenly start working. Therefore you have to research, usually by reading, why you have the problem and how to solve it.

In some cases you can use trial and error with a value to change a result, but as Luc hinted, it would be better to read a book on basics than to just 'do' stuff until it passes the compiler checks (which does not guarantee it will work how you want anyway)


Anyway, to make a contribution to your OP...

Based on the example you gave, I think a property would be best suited here...

public static string ABC{
  get{return x.group;}
}


...this avoids the needless parameter and if statement in your function, however if you need a function like you have exemplified then I would do as follows...

public static string Test(Guid id)
{
    if(a == n)
       return x.group;
    return string.Empty;
}


I hope you avoidance of reading has not had an impact on your ability to read my post...

Good luck for the future

Life goes very fast. Tomorrow, today is already yesterday.

GeneralRe: return string Pin
Joe Woodbury14-Jul-09 6:48
professionalJoe Woodbury14-Jul-09 6:48 
GeneralRe: return string Pin
musefan14-Jul-09 6:57
musefan14-Jul-09 6:57 
GeneralRe: return string Pin
Luc Pattyn14-Jul-09 7:04
sitebuilderLuc Pattyn14-Jul-09 7:04 
GeneralRe: return string [modified] Pin
Joe Woodbury14-Jul-09 7:07
professionalJoe Woodbury14-Jul-09 7:07 
GeneralRe: return string Pin
AndyInUK15-Jul-09 5:20
AndyInUK15-Jul-09 5:20 
GeneralRe: return string Pin
Joe Woodbury15-Jul-09 5:35
professionalJoe Woodbury15-Jul-09 5:35 
JokeRe: return string Pin
musefan14-Jul-09 7:18
musefan14-Jul-09 7:18 
GeneralRe: return string Pin
Luc Pattyn14-Jul-09 7:45
sitebuilderLuc Pattyn14-Jul-09 7:45 
AnswerRe: return string Pin
sskset14-Jul-09 7:52
sskset14-Jul-09 7:52 
Questionregarding grab image from mobile camera?? Pin
Tridip Bhattacharjee14-Jul-09 2:34
professionalTridip Bhattacharjee14-Jul-09 2:34 
AnswerRe: regarding grab image from mobile camera?? Pin
DoctorMick14-Jul-09 5:19
DoctorMick14-Jul-09 5:19 
AnswerRe: regarding grab image from mobile camera?? Pin
Simon P Stevens14-Jul-09 5:25
Simon P Stevens14-Jul-09 5:25 
AnswerRe: regarding grab image from mobile camera?? Pin
Giorgi Dalakishvili14-Jul-09 6:18
mentorGiorgi Dalakishvili14-Jul-09 6:18 
QuestionLogin Problem with CrystalReports Pin
Narendra Reddy Vajrala14-Jul-09 1:59
Narendra Reddy Vajrala14-Jul-09 1:59 
QuestionLogic behind... Something? Pin
Baeltazor14-Jul-09 1:18
Baeltazor14-Jul-09 1:18 
AnswerRe: Logic behind... Something? PinPopular
Luc Pattyn14-Jul-09 1:27
sitebuilderLuc Pattyn14-Jul-09 1:27 
GeneralRe: Logic behind... Something? Pin
Baeltazor14-Jul-09 1:31
Baeltazor14-Jul-09 1:31 

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.