Results 1 to 8 of 8

Thread: Hmmm help on continues.

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

    Default Hmmm help on continues.

    anyone have a link to a tut on the continue command?

    or can explain its use?
    ++ examples?
    AKA http://i105.photobucket.com/albums/m...uceSigcopy.jpg

    I am a SCAR//SRL newb and i am willing to become better =) reading my tut's day by day.

  2. #2
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    K I believe (someone please correct me if I'm wrong) that it is kind of like repeating until the condition is opposite of what you have it.

    EX.
    SCAR Code:
    begin
      repeat
        WriteLn('will repeat this');
        WriteLn('and this');
        if (GetColor(420, 16)=15357184) then Continue; //it will continue doing this and EVERYTHING BEFORE IT until... the color is NOT 15357184
          WriteLn('then will move on here');
      until (false)
    end.

  3. #3
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Basically the command continue, When your repeating.... if you call continue it will skip the code.. and get to the next repeat...



    SCAR Code:
    program new;


    var i: Integer;
    begin
     for i:= 0 to 10 do
     begin
       if (i > 5) then Continue;
       Writeln(inttostr(i));
     end;

    end.
    Co Founder of https://www.tagcandy.com

  4. #4
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by SKy Scripter View Post
    Basically the command continue, When your repeating.... if you call continue it will skip the code.. and get to the next repeat...



    SCAR Code:
    program new;


    var i: Integer;
    begin
     for i:= 0 to 10 do
     begin
       if (i > 5) then Continue;
       Writeln(inttostr(i));
     end;

    end.
    Well actualy it just breaks out of the loop if I'm correctly, not really going to another loop, you have to be clear over here

    Because what I understood about what you've said was that it would skip out of the loop and goes to the next loop.. which is incorrect.

    SCAR Code:
    program new;
    var i, c: Integer;

    begin
     for i:= 0 to 10 do
     begin
       if (i > 5) then Continue;
       Writeln(inttostr(i));
     end;
     Writeln('haha');
     repeat
       writeln('.');
       inc(c);
     until c>1
    end.

    This will also output the "haha", which means that it just breaks out of the loop.

    I don't want to be the smartass() I just want to make things clear over tho the newcomers..

    -Tsn.

    P.S. Don't watch my english grammar, I know that that last sentence is wrong, but you should get what I mean
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  5. #5
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by the scar noob View Post
    Well actualy it just breaks out of the loop if I'm correctly, not really going to another loop, you have to be clear over here

    Because what I understood about what you've said was that it would skip out of the loop and goes to the next loop.. which is incorrect.

    SCAR Code:
    program new;
    var i, c: Integer;

    begin
     for i:= 0 to 10 do
     begin
       if (i > 5) then Continue;
       Writeln(inttostr(i));
     end;
     Writeln('haha');
     repeat
       writeln('.');
       inc(c);
     until c>1
    end.

    This will also output the "haha", which means that it just breaks out of the loop.

    I don't want to be the smartass() I just want to make things clear over tho the newcomers..

    -Tsn.

    P.S. Don't watch my english grammar, I know that that last sentence is wrong, but you should get what I mean


    no your not being a smart ass cause your wrong lol
    Cleary you can see from this example that its skipping loops
    SCAR Code:
    program new;
    var i: Integer;

    begin
     for i:= 0 to 10 do
     begin
       if ((i mod 2) = 0) then Continue;
       Writeln(inttostr(i));
     end;

    end.
    Co Founder of https://www.tagcandy.com

  6. #6
    Join Date
    Jan 2007
    Posts
    55
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ummm..... then what is the correct usage?
    AKA http://i105.photobucket.com/albums/m...uceSigcopy.jpg

    I am a SCAR//SRL newb and i am willing to become better =) reading my tut's day by day.

  7. #7
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by SKy Scripter View Post
    no your not being a smart ass cause your wrong lol
    Cleary you can see from this example that its skipping loops
    SCAR Code:
    program new;
    var i: Integer;

    begin
     for i:= 0 to 10 do
     begin
       if ((i mod 2) = 0) then Continue;
       Writeln(inttostr(i));
     end;

    end.
    You don't get me, damn I have to learn english
    You said that it goes to the other repeat, which is wrong, it will break out of the current one, not go to the other one.. that's my point

    -Tsn.

    EDIT; Let's show me by editing your script:
    SCAR Code:
    program new;

    var i, c: Integer;
    begin
     for i:= 0 to 10 do
     begin
       if (i > 5) then Continue;
       Writeln(inttostr(i));
     end;
     Writeln('if it writes this, it means that it breaks out of the loop'+
     ', not go on with the other one, but the things between it aswell');
     for c:=0 to 5 do
     begin
       if c>2 then Continue;
       Writeln(inttostr(c));
     end;
    end.

    You said that it goes to the other loop, which I understand from that it wouldn't do the things between the current loop and the next one, you get what I mean now?
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  8. #8
    Join Date
    Apr 2007
    Location
    Laguna Beach, California
    Posts
    231
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Continue restarts the loop.
    Say you have a repeat function in a woodcutting script:

    SCAR Code:
    repeat
      if (FindTreeColor) then
        Mouse(x,y,1,1);
      if (FindEnt) then
        continue;
    until (TreeIsGone);

    so if it found an ent it would go to the top of the loop and restart it.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. hmmm
    By Awkwardsaw in forum OSR Help
    Replies: 35
    Last Post: 05-16-2008, 01:24 PM
  2. hmmm
    By Dangerous Garden Tools in forum OSR Help
    Replies: 2
    Last Post: 01-29-2008, 04:48 AM
  3. hmmm problem..
    By yamaha317 in forum OSR Help
    Replies: 2
    Last Post: 07-12-2007, 06:56 AM

Posting Permissions

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