Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: Call Method Multuple Times Pin
Luc Pattyn8-Jan-09 7:03
sitebuilderLuc Pattyn8-Jan-09 7:03 
QuestionRe: Call Method Multuple Times Pin
Eddy Vluggen8-Jan-09 7:13
professionalEddy Vluggen8-Jan-09 7:13 
GeneralRe: Call Method Multuple Times Pin
Jon Rista8-Jan-09 7:38
Jon Rista8-Jan-09 7:38 
AnswerRe: Call Method Multuple Times [modified] (improved code) Pin
Dan Neely8-Jan-09 8:28
Dan Neely8-Jan-09 8:28 
JokeRe: Call Method Multuple Times Pin
DaveyM698-Jan-09 8:40
professionalDaveyM698-Jan-09 8:40 
GeneralRe: Call Method Multuple Times Pin
Jon Rista8-Jan-09 9:15
Jon Rista8-Jan-09 9:15 
GeneralRe: Call Method Multuple Times [modified] (improved code) Pin
Luc Pattyn8-Jan-09 10:04
sitebuilderLuc Pattyn8-Jan-09 10:04 
GeneralRe: Call Method Multuple Times [modified] (improved code) Pin
Luc Pattyn8-Jan-09 10:09
sitebuilderLuc Pattyn8-Jan-09 10:09 
Hi,

labels too deserve meaningful names, they add to the readability of the source code; so I would suggest:

uint control= count;
WhileThereMayBeMore:
  if (control== 0)
     goto FinallyWhenDone;
  else
     goto ThisIsWhereWeCallTheMethod;

ThisIsWhereWeCallTheMethod:
  MyMethodCall();
  control--;
  goto WhileThereMayBeMore;

FinallyWhenDone:

//do something else


BTW: why is it all examples seem to use PascalCase labels, they are local after all?
(e.g. read MSDN on the goto keyword)

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Love, happiness and fewer bugs for 2009!


GeneralRe: Call Method Multuple Times [modified] (improved code) Pin
Dan Neely8-Jan-09 10:16
Dan Neely8-Jan-09 10:16 
GeneralRe: Call Method Multuple Times [modified] (improved code) Pin
Luc Pattyn8-Jan-09 10:19
sitebuilderLuc Pattyn8-Jan-09 10:19 
GeneralRe: Call Method Multuple Times [modified] (improved code) Pin
Ben Fair9-Jan-09 6:19
Ben Fair9-Jan-09 6:19 
Questionc# live video Pin
omer erakman8-Jan-09 6:50
omer erakman8-Jan-09 6:50 
AnswerRe: c# live video Pin
EliottA8-Jan-09 7:13
EliottA8-Jan-09 7:13 
QuestionColors and Color Pin
mark_w_8-Jan-09 6:03
mark_w_8-Jan-09 6:03 
AnswerRe: Colors and Color Pin
musefan8-Jan-09 6:08
musefan8-Jan-09 6:08 
GeneralRe: Colors and Color Pin
mark_w_8-Jan-09 6:14
mark_w_8-Jan-09 6:14 
GeneralRe: Colors and Color [modified] Pin
musefan8-Jan-09 6:19
musefan8-Jan-09 6:19 
GeneralRe: Colors and Color Pin
mark_w_8-Jan-09 6:22
mark_w_8-Jan-09 6:22 
AnswerRe: Colors and Color Pin
DaveyM698-Jan-09 6:22
professionalDaveyM698-Jan-09 6:22 
GeneralRe: Colors and Color Pin
mark_w_8-Jan-09 6:25
mark_w_8-Jan-09 6:25 
GeneralRe: Colors and Color Pin
musefan8-Jan-09 6:26
musefan8-Jan-09 6:26 
QuestionSource Control Pin
CodingYoshi8-Jan-09 5:48
CodingYoshi8-Jan-09 5:48 
AnswerRe: Source Control Pin
Lev Danielyan8-Jan-09 5:52
Lev Danielyan8-Jan-09 5:52 
AnswerRe: Source Control Pin
DaveyM698-Jan-09 5:54
professionalDaveyM698-Jan-09 5:54 
AnswerRe: Source Control Pin
User 66588-Jan-09 6:24
User 66588-Jan-09 6:24 

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.