Results 1 to 7 of 7

Thread: While question

  1. #1
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default While question

    Repeat is the exact same thing as while, just more convenient. But how would you end a while line?

    Like,
    SCAR Code:
    For I := 0 to 10 Do
    This;
    That;
    And_This;
    ///STOP here and goes on with the script like an Until
    More_Stuff;

  2. #2
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    For I := 0 to 10 Do
    begin
      This;
      That;
      And_This;
    end;///STOP here and goes on with the script like an Until
    More_Stuff;
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  3. #3
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ahh, just like a case. Thanks bionicle.

  4. #4
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    btw this is a for-to-do loop, not a while-do
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  5. #5
    Join Date
    Mar 2009
    Location
    Illinois
    Posts
    292
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    while i := 0 to high(whatever) do
      begin
        yourmom;
        imaleethax0r;
      end;

    You can also use a break with an if then i.e.

    SCAR Code:
    while i := 0 to high(hahahahaomg) do
      begin
      ohai;
        if(imleet)then
          break;
      end;

    Which the break will break from the loop where ever its at

    E: Wow epicly failed ninja

  6. #6
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    actually, a while loop is
    SCAR Code:
    while this do
    begin
      that
      orly
      thatagain
    end;
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  7. #7
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    The difference between a while loop and a repeat..until loop is that the while loop checks its condition at the beginning of a loop, while repeat checks it at the end.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •