Results 1 to 5 of 5

Thread: Could Not Call Proc

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Could Not Call Proc

    Okay, i got a stable Bitmap search now.

    But I'm getting another error, which i cant seem to understand : '(
    Code:
     SetArrayLength(Field, 5);
      SetArrayLength(Field[0], 5);
        SetArrayLength(Field[0][0], 5); // ERROR is here
      
      for i:= 0 to high(fruit)-1 do
      begin
        Field[i][i].x := 2; //2 is a placeholder.. LINE 156..
      end;
    [Runtime Error] : Could not call proc in line 156 in script

    Field is an Array of TpointArray.

    Hope you can help me out again, It's probably something stupid and im too tired too see it ... but its keeping me busy for nearly an hour now ..

    ~caused

  2. #2
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You have to have array of array of tpointarray to do that.

  3. #3
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Code:
    SetArrayLength(Field[0][0], 5);
    That line isn't like the ones before. This is an element not an array.

    Code:
    SetArrayLength(Field[0], 5);
    Field[0] is the first Array in the 2dimensional array so you can set a length to that.

    Field[0][0] is getting the first index (or element) of the 1st array. So you can't set a length to it, you can set it to be a value but not a length.

    Code:
    Field[0][0] := 456;
    That would be the correct usage of Field[0][0].

    Doing SetArrayLength on it would be like doing...

    Code:
    var i: integer;
    SetArrayLength(i, 5);
    i isn't an array, just like Field[0][0] isn't an array it is an element in the array, the first index of that array.

    Hope this helps.
    Last edited by HyperSecret; 07-06-2009 at 12:19 PM.

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  4. #4
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    thanks

  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did doing what I said solve the problem?

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
  •