-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathlayout.variables.fmfn
More file actions
29 lines (28 loc) · 1018 Bytes
/
layout.variables.fmfn
File metadata and controls
29 lines (28 loc) · 1018 Bytes
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
/*
* =====================================================
* layout.variables ( scope )
*
* RETURNS: (string) key/value pairs as $key = value in positional order
* PARAMETERS: @scope = (enum) global, local
* DEPENDENCIES: none
* ABOUT: Takes two compliment set of lists
* and turns them into FMP defined variables
* NOTES: none
* =====================================================
*
*/
Let ( [
var.fieldNames = FieldNames ( Get ( FileName ) ; Get ( LayoutName ) );
var.prefix = "Let ( var.value = GetField ( \"";
var.suffix = "\" ); If ( IsEmpty ( var.value ) ; \"-\" ; var.value ) ) &\¶&";
var.calculation = var.prefix &
Substitute (
var.fieldNames;
[ ¶ ; ¶ & var.prefix ];
[ ¶ ; var.suffix & ¶ ]
) & var.suffix;
var.calculation = Left ( var.calculation ; Length ( var.calculation ) - 3 ); // trim off last concatenation
var.fieldData = Evaluate ( var.calculation )
];
var.list ( var.fieldNames ; var.fieldData ; scope )
)