forked from DonovanChan/fmfunctions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListSortDatesLoop.calc
38 lines (28 loc) · 1.11 KB
/
ListSortDatesLoop.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
38
Case(
(ValueCount( list1 ) < 1) or (ValueCount( list2 ) < 1);
Case( ValueCount( list1 ) < 1; list2; list1 );
GetAsDate ( GetValue( list1; 1 ) ) < GetAsDate ( GetValue( list2; 1 ) );
GetValue( list1; 1 ) & "¶" &
ListSortLoop( RightValues( list1; ValueCount( list1 ) - 1 ); list2);
GetValue( list2; 1 ) & "¶" &
ListSortLoop( list1; RightValues( list2; ValueCount( list2 ) - 1 ) )
)
/* —————————————————————————————— //
NAME:
ListSortDatesLoop( 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)
2008-06-17 Donovan Chandler : Formatting and comments
2014-09-05 Donovan Chandler : Repurposed for sorting dates
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/
*/