Click here to Skip to main content
15,918,049 members
Home / Discussions / C#
   

C#

 
QuestionMessage Filter Pin
electriac3-Oct-10 11:37
electriac3-Oct-10 11:37 
AnswerRe: Message Filter Pin
Henry Minute3-Oct-10 11:49
Henry Minute3-Oct-10 11:49 
AnswerRe: Message Filter Pin
Dave Kreskowiak3-Oct-10 11:58
mveDave Kreskowiak3-Oct-10 11:58 
GeneralRe: Message Filter Pin
electriac3-Oct-10 12:03
electriac3-Oct-10 12:03 
AnswerRe: Message Filter Pin
Luc Pattyn3-Oct-10 12:03
sitebuilderLuc Pattyn3-Oct-10 12:03 
QuestionYield break Pin
Brij3-Oct-10 8:12
mentorBrij3-Oct-10 8:12 
AnswerRe: Yield break Pin
harold aptroot3-Oct-10 8:48
harold aptroot3-Oct-10 8:48 
AnswerRe: Yield break Pin
Henry Minute3-Oct-10 8:56
Henry Minute3-Oct-10 8:56 
From the relevant MSDN page for break:

The break statement terminates the closest enclosing loop or switch statement in which it appears. Control is passed to the statement that follows the terminated statement, if any.


So break breaks out of loops and switch statements. I am guessing that in this case it breaks out of your method.

Same for yield:

Used in an iterator block to provide a value to the enumerator object or to signal the end of iteration.


Once again yield is meant to be used in an iteration. if is not strictly speaking an iteration, although I suspect that your else block would run.

The pages I looked at did not say what these statements do when not used in iterations.
Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

AnswerRe: Yield break Pin
PIEBALDconsult3-Oct-10 8:58
mvePIEBALDconsult3-Oct-10 8:58 
GeneralRe: Yield break Pin
Brij3-Oct-10 9:15
mentorBrij3-Oct-10 9:15 
AnswerRe: Yield break Pin
Pete O'Hanlon3-Oct-10 9:21
mvePete O'Hanlon3-Oct-10 9:21 
GeneralRe: Yield break Pin
Brij3-Oct-10 9:28
mentorBrij3-Oct-10 9:28 
GeneralRe: Yield break Pin
Pete O'Hanlon3-Oct-10 9:42
mvePete O'Hanlon3-Oct-10 9:42 
GeneralRe: Yield break Pin
Brij3-Oct-10 9:56
mentorBrij3-Oct-10 9:56 
GeneralRe: Yield break Pin
Luc Pattyn3-Oct-10 10:16
sitebuilderLuc Pattyn3-Oct-10 10:16 
GeneralRe: Yield break Pin
Pete O'Hanlon3-Oct-10 10:56
mvePete O'Hanlon3-Oct-10 10:56 
GeneralRe: Yield break Pin
Luc Pattyn3-Oct-10 11:04
sitebuilderLuc Pattyn3-Oct-10 11:04 
GeneralRe: Yield break Pin
Pete O'Hanlon3-Oct-10 11:13
mvePete O'Hanlon3-Oct-10 11:13 
Questionscprip's system Pin
noamtzu003-Oct-10 3:48
noamtzu003-Oct-10 3:48 
QuestionTyping in DatagridviewComboboxColumn Pin
jojoba20113-Oct-10 3:47
jojoba20113-Oct-10 3:47 
AnswerSolved: Typing in DatagridviewComboboxColumn Pin
jojoba20113-Oct-10 4:51
jojoba20113-Oct-10 4:51 
AnswerRe: Typing in DatagridviewComboboxColumn Pin
Abhinav S3-Oct-10 4:59
Abhinav S3-Oct-10 4:59 
Questionf Pin
Sajid Maqbool2-Oct-10 23:34
Sajid Maqbool2-Oct-10 23:34 
AnswerRe: f Pin
OriginalGriff2-Oct-10 23:38
mveOriginalGriff2-Oct-10 23:38 
AnswerRe: f Pin
Nagy Vilmos3-Oct-10 3:40
professionalNagy Vilmos3-Oct-10 3:40 

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.