Results 1 to 9 of 9

Thread: For loop

  1. #1
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default For loop

    Hey all,

    Take this for example..
    SCAR Code:
    procedure test;
    begin
      Skip:=1;
      for i:=1 to 3 do;
      begin
        if(Skip=i)then //next?
      end;
    end;

    As you can see i want it to goto the next i. Next doesn't work, i know i could just do if(Not Skill=i)then code, but looks messy .

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  2. #2
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    umm what? lol you want it to skip numbers in ur for loop? you didnt explain it very well.
    ~ Metagen

  3. #3
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol lets say im running a for loop ok, using i from 1 to 4.

    Now elsewhere in my script it has worked out that i don't need number 3 for some reason. Now i want it to skip number 3.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  4. #4
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    var
    i : integer;
    begin
      for i := 1 to 10 do
      begin
        if i = 4 then
          i := 5;
        writeln(inttostr(i));
      end
    end.
    Successfully compiled
    1
    2
    3
    5
    6
    7
    8
    9
    10
    Successfully executed
    ~ Metagen

  5. #5
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hows that work for u?

    (sorry for double post, my scarscript screws over if i try and edit a post with scarscript in it.)
    ~ Metagen

  6. #6
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    As you can see i want it to goto the next i. Next doesn't work, i know i could just do if(Not Skill=i)then code, but looks messy
    Lol, i know i can do it, But i was hoping there was a better way.

    I can just do

    SCAR Code:
    begin
    skip:=1;
      for i:=1 to 5 do
      begin
        if(Skip<>i)then
        writeln('Number '+IntToStr(i));
      end;
    end.

    Just seeing if theres a shorter way.

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  7. #7
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ooooh my bad. I dont know then sorry
    ~ Metagen

  8. #8
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Np, any help is great

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

  9. #9
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Blarg.
    ~ Metagen

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. need for to do loop help
    By Raskolnikov in forum OSR Help
    Replies: 6
    Last Post: 07-02-2008, 03:21 AM
  2. Need help with Loop
    By Brenth in forum OSR Help
    Replies: 2
    Last Post: 12-31-2007, 05:35 PM
  3. Loop help?
    By Becks in forum OSR Help
    Replies: 3
    Last Post: 10-23-2007, 10:32 AM
  4. Help with loop
    By skullbr00d in forum OSR Help
    Replies: 0
    Last Post: 05-29-2007, 09:23 PM
  5. loop
    By macromacro123 in forum OSR Help
    Replies: 4
    Last Post: 03-18-2007, 07:50 PM

Posting Permissions

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