forked from petrowsky/fmpfunctions
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathportal.grouping.fmfn
More file actions
36 lines (33 loc) · 1.22 KB
/
portal.grouping.fmfn
File metadata and controls
36 lines (33 loc) · 1.22 KB
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
/*
* =====================================================
* portal.grouping ( row ; part ; field )
*
* RETURNS: (bool) True or False based on relative portal rows
* DEPENDENCIES: none
* NOTES:
* =====================================================
*
*/
Case (
part = "top";
// Determine if at the top of a group
not IsEmpty ( field ) // I have a value
and
GetNthRecord ( field ; row ) ≠ GetNthRecord ( field ; row - 1 ) // record above me does not match
and
IsValid ( GetNthRecord ( field ; row + 1 ) ); // I do have a record below me
part = "middle";
// Determine if in the middle of a group
not IsEmpty ( field ) // I have a value
and
GetNthRecord ( field ; row ) = GetNthRecord ( field ; row - 1 ) // record above me has the same value
and
GetNthRecord ( field ; row ) = GetNthRecord ( field ; row + 1 ); // record below me has the same value
part = "bottom";
// Determine if at the bottom of a group
not IsEmpty ( field ) // I have a value
and
GetNthRecord ( field ; row ) ≠ GetNthRecord ( field ; row + 1 ) // record below me does not match
and
IsValid ( GetNthRecord ( field ; row + 1 ) ) // there is a record above me
)