Post Reply 
Best way to sort one list based on another?
07-04-2015, 06:51 PM
Post: #3
RE: Best way to sort one list based on another?
Code:

EXPORT parallel_List_sort()
BEGIN
  local name := { "Bird", "Jordan", "O'Neal" }, height := { 2.06, 1.98, 2.16 };

  for I from 1 to length(height) do
    for J from I+1 to length(height) do
      if height(I) > height(J) then 
        L0:=height(I);L1:=name(I);
        name(I):=name(J); height(I):=height(J);
        name(J):=L1(1);height(J):=L0(1);
      end;
    end;     
  end;

  print();
  print(name);
  print(height);
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Best way to sort one list based on another? - DrD - 07-04-2015 06:51 PM



User(s) browsing this thread: 1 Guest(s)