Results 1 to 4 of 4

Thread: Why won't this work =\

  1. #1
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default Why won't this work =\

    SCAR Code:
    For I := 0 To I = High(FoundPlace) Do // It has [0..4] so literally "To I = 5 Do"
        Begin
         FoundPlace[I] := False;
        End;

    It just doesn't work :P
    It works if I do:
    SCAR Code:
    FoundPlace[0] := False;
        FoundPlace[1] := False;
        FoundPlace[2] := False;
        FoundPlace[3] := False;
        FoundPlace[4] := False;

    But that's not really.. convenient if the array gets bigger.
    Ce ne sont que des gueux


  2. #2
    Join Date
    Feb 2007
    Location
    Toronto, Ontario, Canada
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This code actually does work.
    One mistake, will still work although not pedantically correct, AFAIK.
    SCAR Code:
    For I := 0 To I = High(FoundPlace) Do
    -->
    For I := 0 To High(FoundPlace) Do

    Also,
    SCAR Code:
    // It has [0..4] so literally "To I = 5 Do"
    However, High(array [0..4] of x) = 4. GetArrayLength(array [0..4] of x) = 5.

  3. #3
    Join Date
    Mar 2008
    Location
    ::1
    Posts
    915
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I don't know if A G E N T's expanation was confusing so, you don't need the variable in the "to" part of a for loop. It would look like this then :
    SCAR Code:
    for i:=0 to High(FoundPlace) do
    begin
      FoundPlace[i] := false;
    end;

    Records and Types Save Code (and make you look better)
    Quote Originally Posted by Wizzup? View Post
    Is it possible to make Runescape a 2D game with this?... That would greatly simplify... Just about anything.

  4. #4
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Ah silly me.. was thinking of PHP's ForToDo intepretation
    Ce ne sont que des gueux


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how come this does not work?
    By takeout in forum OSR Help
    Replies: 3
    Last Post: 09-14-2007, 03:44 PM
  2. how come this does not work?
    By takeout in forum OSR Help
    Replies: 2
    Last Post: 09-11-2007, 09:19 PM
  3. Been Trying To Get This To Work : /
    By Speci in forum OSR Help
    Replies: 15
    Last Post: 07-21-2007, 12:17 PM
  4. how does rc work
    By del_signo in forum OSR Help
    Replies: 4
    Last Post: 05-10-2007, 02:47 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
  •