Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005
    Posts
    12

    Smile How Do I Sort Table Before Populating Tree?

    Need help sorting table

    folderbrowse1 = "d:\\playlists\\";
    M3U = File.Find(folderbrowse1, "*.m3u", true, false, ShowSearchProgress, nil);
    for i,v in M3U do
    tbSplit = String.SplitPath(v);
    name = tbSplit.Filename
    tblNodeData = {};
    tblNodeData.Text = name;
    tblNodeData.Data = v;
    Tree.InsertNode("Tree1", "3", tblNodeData);
    end

    How do I sort this table before inserting into the tree object?

  2. #2
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Code:
    Table.Sort ( 
     table    SourceTable,
    function Compare = nil )

    Description
    Sorts the items of a numerically indexed table.

    Parameters
    SourceTable
    (table) The table to sort.

    Compare
    (function) An optional comparison function to use while sorting the table. The function should be able to compare two values and return true if the two items are already sorted, or false if the items need to be swapped. If no function is specified, the less than operator (<) will be used to sort the items.

    Returns
    Nothing.


    Source: AMS Help File
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

Similar Threads

  1. Complex populating Tree by XML
    By PFD in forum AutoPlay Media Studio 7.5
    Replies: 0
    Last Post: 01-12-2008, 09:23 AM
  2. Tree Object+DataGrid PageJunp Issue
    By pakapaka in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 09-11-2007, 10:02 AM
  3. Select Tree Node to Display Table
    By pakapaka in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 07-07-2007, 10:58 AM
  4. Sort Tree Items
    By Animl in forum AutoPlay Media Studio 6.0
    Replies: 0
    Last Post: 02-19-2007, 09:05 PM
  5. Alphabetize Table or Tree Object???
    By Animl in forum AutoPlay Media Studio 6.0
    Replies: 3
    Last Post: 07-24-2006, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts