Click here to Skip to main content
15,904,024 members
Home / Discussions / C#
   

C#

 
AnswerRe: Print to POS Printer on serial port Pin
originSH29-Aug-07 3:28
originSH29-Aug-07 3:28 
GeneralRe: Print to POS Printer on serial port Pin
Tavbi29-Aug-07 19:57
Tavbi29-Aug-07 19:57 
AnswerRe: Print to POS Printer on serial port Pin
martin_hughes29-Aug-07 6:58
martin_hughes29-Aug-07 6:58 
GeneralRe: Print to POS Printer on serial port Pin
Tavbi29-Aug-07 20:27
Tavbi29-Aug-07 20:27 
QuestionTab Page Tab_handfold Size Pin
greekius29-Aug-07 2:08
greekius29-Aug-07 2:08 
AnswerRe: Tab Page Tab_handfold Size Pin
goldoche29-Aug-07 2:25
goldoche29-Aug-07 2:25 
Questionmultiple loops Pin
suck12329-Aug-07 1:42
suck12329-Aug-07 1:42 
AnswerRe: multiple loops Pin
Justin Perez29-Aug-07 2:02
Justin Perez29-Aug-07 2:02 
I think I understand what you mean.

To do them at the same time, you will want to nest one loop inside another

<br />
for(int i = 0; i < 10; i++)<br />
{<br />
   for(int x = 0; x < 10; x++)<br />
   {<br />
      Console.Writeline(string.Format("x is = {0}", x.ToString());<br />
   }<br />
   <br />
   Console.Writeline(string.Format("i is = {0}, i.ToString());<br />
}<br />


What will happen is, loop i will initialize, and after executing, it will get to loop x. When it gets to loop x, it will execute, and this output will be produced at the console.

x is = 0
x is = 1
x is = 2 etc etc etc

Once Loop x has finished, loop I will continue, and Loop x will be executed every step through loop i, until it is finished. You could put another loop inside i, or x.

TO run one loop right after another, just do it like you would a regular loop, just with another right after, like so:

<br />
for(int i = 0; i < 10; i++)<br />
{<br />
   Console.Writeline(string.Format("i is = {0}, i.ToString());<br />
}<br />
<br />
for(int x = 0; x < 10; x++)<br />
{<br />
   Console.Writeline(string.Format("x is = {0}", x.ToString());<br />
}<br />
   <br />


Hope that answeres your question

I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")

AnswerRe: multiple loops Pin
Seishin#29-Aug-07 3:10
Seishin#29-Aug-07 3:10 
GeneralRe: multiple loops Pin
Spacix One29-Aug-07 7:18
Spacix One29-Aug-07 7:18 
AnswerRe: multiple loops Pin
Luc Pattyn29-Aug-07 4:44
sitebuilderLuc Pattyn29-Aug-07 4:44 
QuestionMissing namespaces... Pin
Tarun.Suneja29-Aug-07 1:36
Tarun.Suneja29-Aug-07 1:36 
AnswerRe: Missing namespaces... [modified] Pin
Vasudevan Deepak Kumar29-Aug-07 2:02
Vasudevan Deepak Kumar29-Aug-07 2:02 
GeneralRe: Missing namespaces... Pin
Tarun.Suneja29-Aug-07 2:19
Tarun.Suneja29-Aug-07 2:19 
GeneralRe: Missing namespaces... Pin
Vasudevan Deepak Kumar29-Aug-07 3:19
Vasudevan Deepak Kumar29-Aug-07 3:19 
QuestionGet list of files from ftp Pin
toink toink29-Aug-07 1:30
toink toink29-Aug-07 1:30 
AnswerRe: Get list of files from ftp Pin
Vasudevan Deepak Kumar29-Aug-07 2:03
Vasudevan Deepak Kumar29-Aug-07 2:03 
QuestionBinding GridView to a child obect in a list Pin
oceanexplorer29-Aug-07 1:01
oceanexplorer29-Aug-07 1:01 
QuestionPerfect Timing! Pin
pokabot29-Aug-07 0:52
pokabot29-Aug-07 0:52 
AnswerRe: Perfect Timing! Pin
J4amieC29-Aug-07 1:04
J4amieC29-Aug-07 1:04 
GeneralRe: Perfect Timing! Pin
originSH29-Aug-07 1:11
originSH29-Aug-07 1:11 
AnswerRe: Perfect Timing! Pin
Christian Graus29-Aug-07 2:05
protectorChristian Graus29-Aug-07 2:05 
GeneralRe: Perfect Timing! Pin
pokabot29-Aug-07 3:00
pokabot29-Aug-07 3:00 
AnswerRe: Perfect Timing! Pin
Hessam Jalali29-Aug-07 5:08
Hessam Jalali29-Aug-07 5:08 
QuestionsaveFileDialog Pin
lourensG29-Aug-07 0:28
lourensG29-Aug-07 0:28 

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.