Results 1 to 7 of 7

Thread: T2DPointArray incompatible with FindColorsSpiralTolerance

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

    Default T2DPointArray incompatible with FindColorsSpiralTolerance

    I was trying to do something like this:

    FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[0], TreeColor[0], MSX1, MSY1, MSX2, MSY2, 5);
    FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[1], TreeColor[1], MSX1, MSY1, MSX2, MSY2, 5);
    FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[2], TreeColor[2], MSX1, MSY1, MSX2, MSY2, 5);

    Where TreeColorTPAs is defined as a T2DPoint array. I tried it both with setting the array length and not. It works when i declare it as an array [0..2] of TPointArray however.

    So this : TreeColorTPAs : T2DPointArray; doesnt work and
    this : TreeColorTPAs : array [0..2] of TPointArray; does.

    I may be doing something wrong because i am inexperience with TPAs but I am pretty sure its incompatable.

    I was going to post this in the bug section but it wouldnt let me because there were no drop down options in the required drop downs.
    A bug in the bug section... gasp.

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    You can use 'Array[0..2] of TPointArray;' instead of T2DPointArray and it will work fine (though you have to increase the 2 if adding more FindColors). I'm guessing that it became incompatible after SRL 14 as there have been a couple of other issues with TPointArrayArray's, though you can never be sure.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

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

    Default

    Yea I know, I did that and it did work fine. I'm just saying if its incompatible it should be fixed just for simplicity. And likewise it's not really a scripting help error i just couldn't post it in the bug section.

  4. #4
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    If you're gonna do this:
    SCAR Code:
    var
      Blah: T2DPointArray;

    you need to set the length of the array. Do this by calling set length.
    For example:
    SCAR Code:
    var
      TreeColorTPAs: T2DPointArray;
    begin
      SetLength(3);  //set the length of the array to 3.
      FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[0], TreeColor[0], MSX1, MSY1, MSX2, MSY2, 5);
      FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[1], TreeColor[1], MSX1, MSY1, MSX2, MSY2, 5);
      FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[2], TreeColor[2], MSX1, MSY1, MSX2, MSY2, 5);

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

    Default

    Yea I did that too, like I said. I am pretty sure it's just something wrong with the types that the Devs need to fix. I'm fine using the var : array [0..2] of TPointArray... I'm just saying if they have the T2DPointArray they might as well make it compatable.

  6. #6
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    It's a bug that is fixed in the next SCAR.
    Hup Holland Hup!

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

    Default

    thanks nielsie

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
  •