-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathListSortLoop.calc
37 lines (27 loc) · 1.04 KB
/
ListSortLoop.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Case(
(ValueCount( list1 ) < 1) or (ValueCount( list2 ) < 1);
Case( ValueCount( list1 ) < 1; list2; list1 );
GetValue( list1; 1 ) < GetValue( list2; 1 );
GetValue( list1; 1 ) & "¶" &
ListSortLoop( RightValues( list1; ValueCount( list1 ) - 1 ); list2);
GetValue( list2; 1 ) & "¶" &
ListSortLoop( list1; RightValues( list2; ValueCount( list2 ) - 1 ) )
)
/* —————————————————————————————— //
NAME:
ListSortLoop( list1; list2 )
v1.1
PURPOSE:
Merges two sorted lists into a single sorted list. Used by list.sort().
HISTORY:
Created by Soliant Consulting (See below or FM 8 Functions p. 229)
Modified 2008.06.17 by DChandler for formatting/commenting preference
INPUT:
Two sorted, return-delimited lists
OUTPUT:
A single sorted return-delimited list
Function created by Soliant Consulting
www.soliantconsulting.com
Released under the Creative Commons Attribution 2.5 License
http://creativecommons.org/licenses/by/2.5/
*/