-
Notifications
You must be signed in to change notification settings - Fork 16
/
error.calculation.fmfn
33 lines (28 loc) · 1.05 KB
/
error.calculation.fmfn
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
/*
* =====================================================
* error.reference ( elementName ; requiredElementNames ; requiredType )
*
* PARAMETERS: @elementName = FileMaker field reference
* @requiredElementNames = List() of required element names
* @requiredTypes = matching list of types for each element
* RETURNS: (boolean) Whether or not there is a calculation error
* DEPENDENCIES: none
* NOTES: none
* =====================================================
*
*/
Let ( [
$$ERROR.REFERENCE = FilterValues ( Case (
requiredType = "Table";
TableNames ( Get ( FileName ) );
requiredType = "Field";
FieldNames ( Get ( FileName ) ; Get ( LayoutName ) );
requiredType = "Layout";
LayoutNames ( Get ( FileName ) );
""
); requiredElementNames ) ≠ requiredElementNames &¶;
// Set the error into the global if required elements were not found
$$ERROR.REFERENCE = If ( $$ERROR.REFERENCE; elementName & ": Missing literal references"; "" )
];
If ( not IsEmpty ( $$ERROR.REFERENCE ); True; False )
)