Results 1 to 4 of 4

Thread: T2DIntegerArray assignment & TPA

  1. #1
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default T2DIntegerArray assignment & TPA

    I know that you can assign values of an T2DIntegerArray using:
    T2D[0]:=[1,2,3];
    T2D[1]:=[5,6,1,4];
    But is there a shorter way of doing it? Like how u can assign TPA values by
    TPA:=[Point(1,2),Point(1,3)] (instead of TPA[0]:=Point(1,2) and so on).

    I've tried things like
    T2D:=[ [1,2], [3,4] ];
    which doesn't compile


    Also regarding TPAs, what is the point of setting Length? (i commented it out and found that it still works like exactly the same) Also is there any difference b/w SetLength and SetArrayLength?


    And lastly..regarding this extremely long Wizzy Plugin tutorial, what's the difference b/w those '69' pictures? (the inv cowhides) if it 'modifies our array to only contain 1 point in a 26x20 box', why is it that the whole inv is being debugged?

    Any help will be appreciated Thanks in advance.

  2. #2
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    I think the best you can do is:

    Simba Code:
    var
      Foo: T2DIntegerArray;
      Meh: TIntegerArray;

    begin
      Foo := [Meh, Meh, Meh];
    end;

    Simba Code:
    var
      Foo: T2DIntegerArray;
      Meh: TIntegerArray;

    begin
      Foo := [Meh := [1, 2, 3], Meh := [4, 5, 9]];
      writeln(Foo);
    end;


    EDIT: Hmm MasterBB Got it..

    So, instead to get around it, either use example 1 which assigns a list of static arrays at compile time or use the subscript operator with the assignment operator within the 2D array for dynamic arrays.
    Last edited by Brandon; 08-11-2012 at 03:27 PM.
    I am Ggzz..
    Hackintosher

  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Simba Code:
    var
      Foo: T2DIntegerArray;

    begin
      Foo := [TIntegerArray([1, 2, 3]), TIntegerArray([4, 5, 6])];
      writeln(Foo);
    end.
    Working on: Tithe Farmer

  4. #4
    Join Date
    Dec 2011
    Location
    The Netherlands
    Posts
    1,631
    Mentioned
    47 Post(s)
    Quoted
    254 Post(s)

    Default

    RAaSTPAEx converts a TPA to boxes with certain distances between eachother.

    Script source code available here: Github

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
  •