Results 1 to 8 of 8

Thread: grid() function

  1. #1
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Question grid() function

    This is likely in the wrong sub-forum. Couldn't figure out where to put it.

    Perusing the SRL code I notice it uses the grid() function to setup its TBoxArrays. Not familiar with this one. Anyone have the details of how this one works? I usually just rely on auto-complete in Simba to see what a functions params are but it isn't working for this one. Can't find reference to it in the official docs, searching the forums, or good ol' google.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

  2. #2
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    From math.simba in srl6:
    Simba Code:
    (*
    grid
    ~~~~

    .. code-block:: pascal

        function grid(columns, rows, w, h, diffX, diffY: integer; starTPoint: TPoint): TBoxArray;

    Returns a grid of TBoxes (see gridBox for parameters).

    .. note::

        - by Coh3n
        - Last Modified: Jan. 25th, 2012 by Coh3n

    Example:

    .. code-block:: pascal

        SMART_DrawBoxes(false, grid(5, 10, 20, 20, 25, 25, point(30, 30)), clYellow);
    *)

    function grid(columns, rows, w, h, diffX, diffY: integer; starTPoint: TPoint): TBoxArray;
    var
      i: integer;
    begin
      setLength(result, (columns * rows));

      for i := 0 to high(result) do
        result[i] := gridBox(i, columns, rows, w, h, diffX, diffY, starTPoint);
    end;

  3. #3
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    Thought SRL/SRL used grid but it uses .Partition which looks like it's slightly different...

    oh well best bet is to try guessing your way to what the different params are by trial, eror & debug.
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

  4. #4
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by acow View Post
    From math.simba in srl6:
    Didn't see that. Quick search in Simba failed me. Didn't find it and I was too lazy to do a proper search using Notepad++.

    Quote Originally Posted by Joopi View Post
    h well best bet is to try guessing your way to what the different params are by trial, eror & debug.
    LOL that is what I was trying to avoid. But I think I have enough to go on now.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

  5. #5
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by Bixby Sayz View Post
    Didn't see that. Quick search in Simba failed me. Didn't find it and I was too lazy to do a proper search using Notepad++.

    LOL that is what I was trying to avoid. But I think I have enough to go on now.
    I typed out the word grid on simba (with srl6 being included at the top of the script) & then ctrl + left click'd it.

  6. #6
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Also found here.

  7. #7
    Join Date
    Aug 2009
    Location
    Nova Scotia, Canada
    Posts
    604
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by acow View Post
    I typed out the word grid on simba (with srl6 being included at the top of the script) & then ctrl + left click'd it.
    I just learned a useful trick.
    Never ever approach a computer saying or even thinking "I will just do this quickly".

  8. #8
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Quote Originally Posted by Bixby Sayz View Post
    I just learned a useful trick.


    Searching the [relevant] github for code, like citrus linked would've been my backup plan. Followed by saying it's not my problem & giving up after that.

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
  •