Results 1 to 14 of 14

Thread: Why is this an out of range?

  1. #1
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Why is this an out of range?

    SCAR Code:
    for i := 0 to 1 do
      begin
        BarrierSearchBoxes[i].x1 := MSX1 + ((MSX2-MSX1) /5) * (i div 5));//Identifier expected @ just after div
        BarrierSearchBoxes[i].x2 := MSX1 + ((MSX2-MSX1) /5) * ((i div 5) + 1));
        BarrierSearchBoxes[i].y1 := MSY1 + ((MSY2-MSY1) /5) * (i mod 5));
        BarrierSearchBoxes[i].y2 := MSY1 + ((MSY2-MSY1) /5) * ((i mod 5) + 1));
      end;
    Last edited by Cigue; 01-28-2010 at 10:52 PM.
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    1 extra ) in every line.
    There used to be something meaningful here.

  3. #3
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    SetLength(BarrierSearchBoxes, 2);

  4. #4
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Nothing wrong with that.

    SCAR Code:
    SetLength(BarrierSearchBoxes, 2);
    What is THAT
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  5. #5
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    1 extra ) in every line.
    Quote Originally Posted by Cigue View Post
    What is THAT
    You need to set an array length silly boi

  6. #6
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry, I'd forgotten all about arrays >.<
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  7. #7
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cigue View Post
    What is THAT
    It sets the length of the array so that array[0] and array[1] (which you try accessing in that loop, creating the out of range error) are initialized. In addition, you're missing an opening parentheses "(" on each line:

    SCAR Code:
    for i := 0 to 1 do
      begin
        BarrierSearchBoxes[i].x1 := MSX1 + (((MSX2-MSX1) /5) * (i div 5));//Identifier expected @ just after div
        BarrierSearchBoxes[i].x2 := MSX1 + (((MSX2-MSX1) /5) * ((i div 5) + 1));
        BarrierSearchBoxes[i].y1 := MSY1 + (((MSY2-MSY1) /5) * (i mod 5));
        BarrierSearchBoxes[i].y2 := MSY1 + (((MSY2-MSY1) /5) * ((i mod 5) + 1));
      end;

  8. #8
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Allright, but I still get identifier expected :S how does div works?
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  9. #9
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cigue View Post
    Allright, but I still get identifier expected :S how does div works?
    div divides and leaves off decimal points, your identifier error was from not having an equal amount of open and close parentheses.

  10. #10
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay thanks

    One last... PixelShiftMulti lags so badly that it freezes the screen, so when it looks for animations it returns nothing because screen is frozen (lol.)

    what do I do
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

  11. #11
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Cigue View Post
    okay thanks

    One last... PixelShiftMulti lags so badly that it freezes the screen, so when it looks for animations it returns nothing because screen is frozen (lol.)

    what do I do
    Don't use it then?

  12. #12
    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

    Quote Originally Posted by Cigue View Post
    okay thanks

    One last... PixelShiftMulti lags so badly that it freezes the screen, so when it looks for animations it returns nothing because screen is frozen (lol.)

    what do I do
    Unfortunatly, i don't think there is anything you can do. I had this same problem when i used Animating (which uses PixelShift, which should be less laggy then PixelShiftMulti) to detect whether my character was moving or not. It lagged, just the slightest bit, and it came back false even when it was true.
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  13. #13
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Tad View Post
    It sets the length of the array so that array[0] and array[1] (which you try accessing in that loop, creating the out of range error) are initialized. In addition, you're missing an opening parentheses "(" on each line:

    SCAR Code:
    for i := 0 to 1 do
      begin
        BarrierSearchBoxes[i].x1 := MSX1 + (((MSX2-MSX1) /5) * (i div 5));//Identifier expected @ just after div
        BarrierSearchBoxes[i].x2 := MSX1 + (((MSX2-MSX1) /5) * ((i div 5) + 1));
        BarrierSearchBoxes[i].y1 := MSY1 + (((MSY2-MSY1) /5) * (i mod 5));
        BarrierSearchBoxes[i].y2 := MSY1 + (((MSY2-MSY1) /5) * ((i mod 5) + 1));
      end;
    This fixes the error for me....?

  14. #14
    Join Date
    Sep 2009
    Posts
    580
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh well, it's all sorted out (althought pixelshiftmulti won't work). thank you guys you rock !
    I don't check this place often, sorry.

    Currently working on - Software Engineering degree. Thank you SRL for showing me the one true path

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
  •