Search:

Type: Posts; User: Norm

Search: Search took 0.18 seconds.

  1. Replies
    5
    Views
    1,794

    Re: while(true){ section of code runs only once}

    If the section of code is inside the while loop, then use a boolean oneTime switch in an if statement
    Define the boolean variable as true outside the loop. The inside the loop:


    if (oneTime) {...
  2. Replies
    5
    Views
    1,794

    Re: while(true){ section of code runs only once}

    Remove the while(true) { and ending } and the code will only execute once.

    Do you know about the break statement?
Results 1 to 2 of 2