text:
" ) &
		</Chunk><Chunk type="CustomFunctionRef">#</Chunk><Chunk type="NoRef"> ( "errorScript" ; </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">ScriptName</Chunk><Chunk type="NoRef">) ) &
		</Chunk><Chunk type="CustomFunctionRef">#</Chunk><Chunk type="NoRef"> ( "errorScriptParameter" ; </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">ScriptParameter</Chunk><Chunk type="NoRef"> ) ) &
		</Chunk><Chunk type="CustomFunctionRef">#</Chunk><Chunk type="NoRef"> ( "errorCurrentPrivilegeSetName" ; </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">CurrentPrivilegeSetName</Chunk><Chunk type="NoRef"> ) )  &
		</Chunk><Chunk type="CustomFunctionRef">#</Chunk><Chunk type="NoRef"> ( "errorFileName" ; </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">FileName</Chunk><Chunk type="NoRef"> ) ) ;
		""
	)

)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="10" functionArity="2" visible="True" parameters="type;num" name="ErrorString"><Calculation><![CDATA[/**
 * =====================================
 * ErrorString ( type ; num )
 *
 * PURPOSE:
 *		Provide the human-readable error string associated to a numerical error
 *
 * RETURNS:
 *		(string) An error respective of the type of error
 *
 * PARAMETERS:
 *		type = (enumeration) fmp, app, plugin, func
 *		num = (number) the numerical value for that error type
 *
 * EXAMPLES:
 *		(see Error function)
 *
 * DEPENDENCIES:
 *		none
 *
 * NOTES:
 *		The ErrorString function can be used to contain your own
 *		solution specific errors. It is advised that you use
 *		numerical values within reserved ranges.
 *
 * HISTORY:
 *		MODIFIED on 2011-03-20 by matt@filemakermagazine.com - reformatted
 *
 * REFERENCES:
 *		http://www.filemaker.com/help/html/error_codes.html
 * =====================================
 */

Case (
	type = "fmp";
		Case (
			num = -1; "Unknown error";
			num = 0; "No error";
			num = 1; "User canceled action";
			num = 2; "Memory error";
			num = 3; "Command is unavailable (for example, wrong operating system, wrong mode, etc.)";
			num = 4; "Command is unknown";
			num = 5; "Command is invalid (for example, a Set Field script step does not have a calculation specified)";
			num = 6; "File is read-only";
			num = 7; "Running out of memory";
			num = 8; "Empty result";
			num = 9; "Insufficient privileges";
			num = 10; "Requested data is missing";
			num = 11; "Name is not valid";
			num = 12; "Name already exists";
			num = 13; "File or object is in use";
			num = 14; "Out of range";
			num = 15; "Can't divide by zero";
			num = 16; "Operation failed, request retry (for example, a user query)";
			num = 17; "Attempt to convert foreign character set to UTF-16 failed";
			num = 18; "Client must provide account information to proceed";
			num = 19; "String contains characters other than A-Z, a-z, 0-9 (ASCII)";
			num = 20; "Command/operation canceled by triggered script";
			num = 100; "File is missing";
			num = 101; "Record is missing";
			num = 102; "Field is missing";
			num = 103; "Relationship is missing";
			num = 104; "Script is missing";
			num = 105; "Layout is missing";
			num = 106; "Table is missing";
			num = 107; "Index is missing";
			num = 108; "Value list is missing";
			num = 109; "Privilege set is missing";
			num = 110; "Related tables are missing";
			num = 111; "Field repetition is invalid";
			num = 112; "Window is missing";
			num = 113; "Function is missing";
			num = 114; "File reference is missing";
			num = 115; "Specified menu set is not present";
			num = 116; "Specified layout object is not present";
			num = 117; "Specified data source is not present";
			num = 130; "Files are damaged or missing and must be reinstalled";
			num = 131; "Language pack files are missing (such as template files)";
			num = 200; "Record access is denied";
			num = 201; "Field cannot be modified";
			num = 202; "Field access is denied";
			num = 203; "No records in file to print, or password doesn't allow print access";
			num = 204; "No access to field(s) in sort order";
			num = 205; "User does not have access privileges to create new records; import will overwrite existing data";
			num = 206; "User does not have password change privileges, or file is not modifiable";
			num = 207; "User does not have sufficient privileges to change database schema, or file is not modifiable";
			num = 208; "Password does not contain enough characters";
			num = 209; "New password must be different from existing one";
			num = 210; "User account is inactive";
			num = 211; "Password has expired";
			num = 212; "Invalid user account and/or password; please try again";
			num = 213; "User account and/or password does not exist";
			num = 214; "Too many login attempts";
			num = 215; "Administrator privileges cannot be duplicated";
			num = 216; "Guest account cannot be duplicated";
			num = 217; "User does not have sufficient privileges to modify administrator account";
			num = 300; "File is locked or in use";
			num = 301; "Record is in use by another user";
			num = 302; "Table is in use by another user";
			num = 303; "Database schema is in use by another user";
			num = 304; "Layout is in use by another user";
			num = 306; "Record modification ID does not match";
			num = 400; "Find criteria are empty";
			num = 401; "No records match the request";
			num = 402; "Selected field is not a match field for a lookup";
			num = 403; "Exceeding maximum record limit for trial version of FileMaker Pro";
			num = 404; "Sort order is invalid";
			num = 405; "Number of records specified exceeds number of records that can be omitted";
			num = 406; "Replace/Reserialize criteria are invalid";
			num = 407; "One or both match fields are missing (invalid relationship)";
			num = 408; "Specified field has inappropriate data type for this operation";
			num = 409; "Import order is invalid";
			num = 410; "Export order is invalid";
			num = 412; "Wrong version of FileMaker Pro used to recover file";
			num = 413; "Specified field has inappropriate field type";
			num = 414; "Layout cannot display the result";
			num = 415; "One or more required related records are not available";
			num = 416; "Primary key required from data source table";
			num = 417; "Database is not supported for ODBC operations";
			num = 500; "Date value does not meet validation entry options";
			num = 501; "Time value does not meet validation entry options";
			num = 502; "Number value does not meet validation entry options";
			num = 503; "Value in field is not within the range specified in validation entry options";
			num = 504; "Value in field is not unique as required in validation entry options";
			num = 505; "Value in field is not an existing value in the database file as required in validation entry options";
			num = 506; "Value in field is not listed on the value list specified in validation entry option";
			num = 507; "Value in field failed calculation test of validation entry option";
			num = 508; "Invalid value entered in Find mode";
			num = 509; "Field requires a valid value";
			num = 510; "Related value is empty or unavailable";
			num = 511; "Value in field exceeds maximum number of allowed characters";
			num = 512; "Record was already modified by another user";
			num = 513; "Record must have a value in some field to be created";
			num = 600; "Print error has occurred";
			num = 601; "Combined header and footer exceed one page";
			num = 602; "Body doesn't fit on a page for current column setup";
			num = 603; "Print connection lost";
			num = 700; "File is of the wrong file type for import";
			num = 706; "EPSF file has no preview image";
			num = 707; "Graphic translator cannot be found";
			num = 708; "Can't import the file or need color monitor support to import file";
			num = 709; "QuickTime movie import failed";
			num = 710; "Unable to update QuickTime reference because the database file is read-only";
			num = 711; "Import translator cannot be found";
			num = 714; "Password privileges do not allow the operation";
			num = 715; "Specified Excel worksheet or named range is missing";
			num = 716; "A SQL query using DELETE, INSERT, or UPDATE is not allowed for ODBC import";
			num = 717; "There is not enough XML/XSL information to proceed with the import or export";
			num = 718; "Error in parsing XML file (from Xerces)";
			num = 719; "Error in transforming XML using XSL (from Xalan)";
			num = 720; "Error when exporting; intended format does not support repeating fields";
			num = 721; "Unknown error occurred in the parser or the transformer";
			num = 722; "Cannot import data into a file that has no fields";
			num = 723; "You do not have permission to add records to or modify records in the target table";
			num = 724; "You do not have permission to add records to the target table";
			num = 725; "You do not have permission to modify records in the target table";
			num = 726; "There are more records in the import file than in the target table; not all records were imported";
			num = 727; "There are more records in the target table than in the import file; not all records were updated";
			num = 729; "Errors occurred during import; records could not be imported";
			num = 730; "Unsupported Excel version (convert file to Excel 7.0 (Excel 95), 97, 2000, XP, or 2007 format and try again)";
			num = 731; "The file you are importing from contains no data";
			num = 732; "This file cannot be inserted because it contains other files";
			num = 733; "A table cannot be imported into itself";
			num = 734; "This file type cannot be displayed as a picture";
			num = 735; "This file type cannot be displayed as a picture; it will be inserted and displayed as a file";
			num = 736; "Too much data to export to this format; it will be truncated";
			num = 737; "Bento collection or library is missing; data cannot be imported";
			num = 800; "Unable to create file on disk";
			num = 801; "Unable to create temporary file on System disk";
			num = 802; "Unable to open file";
			num = 803; "File is single user or host cannot be found";
			num = 804; "File cannot be opened as read-only in its current state";
			num = 805; "File is damaged; use Recover command";
			num = 806; "File cannot be opened with this version of FileMaker Pro";
			num = 807; "File is not a FileMaker Pro file or is severely damaged";
			num = 808; "Cannot open file because access privileges are damaged";
			num = 809; "Disk/volume is full";
			num = 810; "Disk/volume is locked";
			num = 811; "Temporary file cannot be opened as FileMaker Pro file";
			num = 813; "Record Synchronization error on network";
			num = 814; "File(s) cannot be opened because maximum number is open";
			num = 815; "Couldn't open lookup file";
			num = 816; "Unable to convert file";
			num = 817; "Unable to open file because it does not belong to this solution";
			num = 819; "Cannot save a local copy of a remote file";
			num = 820; "File is in the process of being closed";
			num = 821; "Host forced a disconnect";
			num = 822; "FMI files not found; reinstall missing files";
			num = 823; "Cannot set file to single-user, guests are connected";
			num = 824; "File is damaged or not a FileMaker file";
			num = 900; "General spelling engine error";
			num = 901; "Main spelling dictionary not installed";
			num = 902; "Could not launch the Help system";
			num = 903; "Command cannot be used in a shared file";
			num = 905; "No active field selected; command can only be used if there is an active field";
			num = 906; "Current file must be shared in order to use this command";
			num = 920; "Can’t initialize the spelling engine";
			num = 921; "User dictionary cannot be loaded for editing";
			num = 922; "User dictionary cannot be found";
			num = 923; "User dictionary is read-only";
			num = 951; "An unexpected error occurred (*)";
			num = 954; "Unsupported XML grammar (*)";
			num = 955; "No database name (*)";
			num = 956; "Maximum number of database sessions exceeded (*)";
			num = 957; "Conflicting commands (*)";
			num = 958; "Parameter missing (*)";
			num = 1200; "Generic calculation error";
			num = 1201; "Too few parameters in the function";
			num = 1202; "Too many parameters in the function";
			num = 1203; "Unexpected end of calculation";
			num = 1204; "Number, text constant, field name or \"(\" expected";
			num = 1205; "Comment is not terminated with \"*/\"";
			num = 1206; "Text constant must end with a quotation mark";
			num = 1207; "Unbalanced parenthesis";
			num = 1208; "Operator missing, function not found or \"(\" not expected";
			num = 1209; "Name (such as field name or layout name) is missing";
			num = 1210; "Plug-in function has already been registered";
			num = 1211; "List usage is not allowed in this function";
			num = 1212; "An operator (for example, +, -, *) is expected here";
			num = 1213; "This variable has already been defined in the Let function";
			num = 1214; "AVERAGE, COUNT, EXTEND, GETREPETITION, MAX, MIN, NPV, STDEV, SUM and GETSUMMARY: expression found where a field alone is needed";
			num = 1215; "This parameter is an invalid Get function parameter";
			num = 1216; "Only Summary fields allowed as first argument in GETSUMMARY";
			num = 1217; "Break field is invalid";
			num = 1218; "Cannot evaluate the number";
			num = 1219; "A field cannot be used in its own formula";
			num = 1220; "Field type must be normal or calculated";
			num = 1221; "Data type must be number, date, time, or timestamp";
			num = 1222; "Calculation cannot be stored";
			num = 1223; "The function is not implemented";
			num = 1224; "The function is not defined";
			num = 1225; "The function is not supported in this context";
			num = 1300; "The specified name can’t be used";
			num = 1400; "ODBC driver initialization failed; make sure the ODBC drivers are properly installed";
			num = 1401; "Failed to allocate environment (ODBC)";
			num = 1402; "Failed to free environment (ODBC)";
			num = 1403; "Failed to disconnect (ODBC)";
			num = 1404; "Failed to allocate connection (ODBC)";
			num = 1405; "Failed to free connection (ODBC)";
			num = 1406; "Failed check for SQL API (ODBC)";
			num = 1407; "Failed to allocate statement (ODBC)";
			num = 1408; "Extended error (ODBC)";
			num = 1409; "Error (ODBC)";
			num = 1413; "Failed communication link (ODBC)";
			num = 1450; "Action requires PHP privilege extension (*)";
			num = 1451; "Action requires that current file be remote";
			num = 1501; "SMTP authentication failed";
			num = 1502; "Connection refused by SMTP server";
			num = 1503; "Error with SSL";
			num = 1504; "SMTP server requires the connection to be encrypted";
			num = 1505; "Specified authentication is not supported by SMTP server";
			num = 1506; "Email(s) could not be sent successfully";
			num = 1507; "Unable to log in to the SMTP server"
		);

	type = "app"; // you can use your own ~ErrorApplication (private function) for app errors
		Case (
			num = 100; "My custom app error";
			num = 200; "Another custom app error";
			"Unknown error"
		);

	type = "plugin"; // you can use your own ~ErrorPlugins (private function) for plugin errors
		"Add plugin specific handling here";

	"Unknown error"
)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * =====================================
 * ErrorString ( type ; num )
 *
 * PURPOSE:
 *		Provide the human-readable error string associated to a numerical error
 *
 * RETURNS:
 *		(string) An error respective of the type of error
 *
 * PARAMETERS:
 *		type = (enumeration) fmp, app, plugin, func
 *		num = (number) the numerical value for that error type
 *
 * EXAMPLES:
 *		(see Error function)
 *
 * DEPENDENCIES:
 *		none
 *
 * NOTES:
 *		The ErrorString function can be used to contain your own
 *		solution specific errors. It is advised that you use
 *		numerical values within reserved ranges.
 *
 * HISTORY:
 *		MODIFIED on 2011-03-20 by matt@filemakermagazine.com - reformatted
 *
 * REFERENCES:
 *		http://www.filemaker.com/help/html/error_codes.html
 * =====================================
 */

</Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef"> (
	type = "fmp";
		</Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef"> (
			num = -1; "Unknown error";
			num = 0; "No error";
			num = 1; "User canceled action";
			num = 2; "Memory error";
			num = 3; "Command is unavailable (for example, wrong operating system, wrong mode, etc.)";
			num = 4; "Command is unknown";
			num = 5; "Command is invalid (for example, a Set Field script step does not have a calculation specified)";
			num = 6; "File is read-only";
			num = 7; "Running out of memory";
			num = 8; "Empty result";
			num = 9; "Insufficient privileges";
			num = 10; "Requested data is missing";
			num = 11; "Name is not valid";
			num = 12; "Name already exists";
			num = 13; "File or object is in use";
			num = 14; "Out of range";
			num = 15; "Can't divide by zero";
			num = 16; "Operation failed, request retry (for example, a user query)";
			num = 17; "Attempt to convert foreign character set to UTF-16 failed";
			num = 18; "Client must provide account information to proceed";
			num = 19; "String contains characters other than A-Z, a-z, 0-9 (ASCII)";
			num = 20; "Command/operation canceled by triggered script";
			num = 100; "File is missing";
			num = 101; "Record is missing";
			num = 102; "Field is missing";
			num = 103; "Relationship is missing";
			num = 104; "Script is missing";
			num = 105; "Layout is missing";
			num = 106; "Table is missing";
			num = 107; "Index is missing";
			num = 108; "Value list is missing";
			num = 109; "Privilege set is missing";
			num = 110; "Related tables are missing";
			num = 111; "Field repetition is invalid";
			num = 112; "Window is missing";
			num = 113; "Function is missing";
			num = 114; "File reference is missing";
			num = 115; "Specified menu set is not present";
			num = 116; "Specified layout object is not present";
			num = 117; "Specified data source is not present";
			num = 130; "Files are damaged or missing and must be reinstalled";
			num = 131; "Language pack files are missing (such as template files)";
			num = 200; "Record access is denied";
			num = 201; "Field cannot be modified";
			num = 202; "Field access is denied";
			num = 203; "No records in file to print, or password doesn't allow print access";
			num = 204; "No access to field(s) in sort order";
			num = 205; "User does not have access privileges to create new records; import will overwrite existing data";
			num = 206; "User does not have password change privileges, or file is not modifiable";
			num = 207; "User does not have sufficient privileges to change database schema, or file is not modifiable";
			num = 208; "Password does not contain enough characters";
			num = 209; "New password must be different from existing one";
			num = 210; "User account is inactive";
			num = 211; "Password has expired";
			num = 212; "Invalid user account and/or password; please try again";
			num = 213; "User account and/or password does not exist";
			num = 214; "Too many login attempts";
			num = 215; "Administrator privileges cannot be duplicated";
			num = 216; "Guest account cannot be duplicated";
			num = 217; "User does not have sufficient privileges to modify administrator account";
			num = 300; "File is locked or in use";
			num = 301; "Record is in use by another user";
			num = 302; "Table is in use by another user";
			num = 303; "Database schema is in use by another user";
			num = 304; "Layout is in use by another user";
			num = 306; "Record modification ID does not match";
			num = 400; "Find criteria are empty";
			num = 401; "No records match the request";
			num = 402; "Selected field is not a match field for a lookup";
			num = 403; "Exceeding maximum record limit for trial version of FileMaker Pro";
			num = 404; "Sort order is invalid";
			num = 405; "Number of records specified exceeds number of records that can be omitted";
			num = 406; "Replace/Reserialize criteria are invalid";
			num = 407; "One or both match fields are missing (invalid relationship)";
			num = 408; "Specified field has inappropriate data type for this operation";
			num = 409; "Import order is invalid";
			num = 410; "Export order is invalid";
			num = 412; "Wrong version of FileMaker Pro used to recover file";
			num = 413; "Specified field has inappropriate field type";
			num = 414; "Layout cannot display the result";
			num = 415; "One or more required related records are not available";
			num = 416; "Primary key required from data source table";
			num = 417; "Database is not supported for ODBC operations";
			num = 500; "Date value does not meet validation entry options";
			num = 501; "Time value does not meet validation entry options";
			num = 502; "Number value does not meet validation entry options";
			num = 503; "Value in field is not within the range specified in validation entry options";
			num = 504; "Value in field is not unique as required in validation entry options";
			num = 505; "Value in field is not an existing value in the database file as required in validation entry options";
			num = 506; "Value in field is not listed on the value list specified in validation entry option";
			num = 507; "Value in field failed calculation test of validation entry option";
			num = 508; "Invalid value entered in Find mode";
			num = 509; "Field requires a valid value";
			num = 510; "Related value is empty or unavailable";
			num = 511; "Value in field exceeds maximum number of allowed characters";
			num = 512; "Record was already modified by another user";
			num = 513; "Record must have a value in some field to be created";
			num = 600; "Print error has occurred";
			num = 601; "Combined header and footer exceed one page";
			num = 602; "Body doesn't fit on a page for current column setup";
			num = 603; "Print connection lost";
			num = 700; "File is of the wrong file type for import";
			num = 706; "EPSF file has no preview image";
			num = 707; "Graphic translator cannot be found";
			num = 708; "Can't import the file or need color monitor support to import file";
			num = 709; "QuickTime movie import failed";
			num = 710; "Unable to update QuickTime reference because the database file is read-only";
			num = 711; "Import translator cannot be found";
			num = 714; "Password privileges do not allow the operation";
			num = 715; "Specified Excel worksheet or named range is missing";
			num = 716; "A SQL query using DELETE, INSERT, or UPDATE is not allowed for ODBC import";
			num = 717; "There is not enough XML/XSL information to proceed with the import or export";
			num = 718; "Error in parsing XML file (from Xerces)";
			num = 719; "Error in transforming XML using XSL (from Xalan)";
			num = 720; "Error when exporting; intended format does not support repeating fields";
			num = 721; "Unknown error occurred in the parser or the transformer";
			num = 722; "Cannot import data into a file that has no fields";
			num = 723; "You do not have permission to add records to or modify records in the target table";
			num = 724; "You do not have permission to add records to the target table";
			num = 725; "You do not have permission to modify records in the target table";
			num = 726; "There are more records in the import file than in the target table; not all records were imported";
			num = 727; "There are more records in the target table than in the import file; not all records were updated";
			num = 729; "Errors occurred during import; records could not be imported";
			num = 730; "Unsupported Excel version (convert file to Excel 7.0 (Excel 95), 97, 2000, XP, or 2007 format and try again)";
			num = 731; "The file you are importing from contains no data";
			num = 732; "This file cannot be inserted because it contains other files";
			num = 733; "A table cannot be imported into itself";
			num = 734; "This file type cannot be displayed as a picture";
			num = 735; "This file type cannot be displayed as a picture; it will be inserted and displayed as a file";
			num = 736; "Too much data to export to this format; it will be truncated";
			num = 737; "Bento collection or library is missing; data cannot be imported";
			num = 800; "Unable to create file on disk";
			num = 801; "Unable to create temporary file on System disk";
			num = 802; "Unable to open file";
			num = 803; "File is single user or host cannot be found";
			num = 804; "File cannot be opened as read-only in its current state";
			num = 805; "File is damaged; use Recover command";
			num = 806; "File cannot be opened with this version of FileMaker Pro";
			num = 807; "File is not a FileMaker Pro file or is severely damaged";
			num = 808; "Cannot open file because access privileges are damaged";
			num = 809; "Disk/volume is full";
			num = 810; "Disk/volume is locked";
			num = 811; "Temporary file cannot be opened as FileMaker Pro file";
			num = 813; "Record Synchronization error on network";
			num = 814; "File(s) cannot be opened because maximum number is open";
			num = 815; "Couldn't open lookup file";
			num = 816; "Unable to convert file";
			num = 817; "Unable to open file because it does not belong to this solution";
			num = 819; "Cannot save a local copy of a remote file";
			num = 820; "File is in the process of being closed";
			num = 821; "Host forced a disconnect";
			num = 822; "FMI files not found; reinstall missing files";
			num = 823; "Cannot set file to single-user, guests are connected";
			num = 824; "File is damaged or not a FileMaker file";
			num = 900; "General spelling engine error";
			num = 901; "Main spelling dictionary not installed";
			num = 902; "Could not launch the Help system";
			num = 903; "Command cannot be used in a shared file";
			num = 905; "No active field selected; command can only be used if there is an active field";
			num = 906; "Current file must be shared in order to use this command";
			num = 920; "Can’t initialize the spelling engine";
			num = 921; "User dictionary cannot be loaded for editing";
			num = 922; "User dictionary cannot be found";
			num = 923; "User dictionary is read-only";
			num = 951; "An unexpected error occurred (*)";
			num = 954; "Unsupported XML grammar (*)";
			num = 955; "No database name (*)";
			num = 956; "Maximum number of database sessions exceeded (*)";
			num = 957; "Conflicting commands (*)";
			num = 958; "Parameter missing (*)";
			num = 1200; "Generic calculation error";
			num = 1201; "Too few parameters in the function";
			num = 1202; "Too many parameters in the function";
			num = 1203; "Unexpected end of calculation";
			num = 1204; "Number, text constant, field name or \"(\" expected";
			num = 1205; "Comment is not terminated with \"*/\"";
			num = 1206; "Text constant must end with a quotation mark";
			num = 1207; "Unbalanced parenthesis";
			num = 1208; "Operator missing, function not found or \"(\" not expected";
			num = 1209; "Name (such as field name or layout name) is missing";
			num = 1210; "Plug-in function has already been registered";
			num = 1211; "List usage is not allowed in this function";
			num = 1212; "An operator (for example, +, -, *) is expected here";
			num = 1213; "This variable has already been defined in the Let function";
			num = 1214; "AVERAGE, COUNT, EXTEND, GETREPETITION, MAX, MIN, NPV, STDEV, SUM and GETSUMMARY: expression found where a field alone is needed";
			num = 1215; "This parameter is an invalid Get function parameter";
			num = 1216; "Only Summary fields allowed as first argument in GETSUMMARY";
			num = 1217; "Break field is invalid";
			num = 1218; "Cannot evaluate the number";
			num = 1219; "A field cannot be used in its own formula";
			num = 1220; "Field type must be normal or calculated";
			num = 1221; "Data type must be number, date, time, or timestamp";
			num = 1222; "Calculation cannot be stored";
			num = 1223; "The function is not implemented";
			num = 1224; "The function is not defined";
			num = 1225; "The function is not supported in this context";
			num = 1300; "The specified name can’t be used";
			num = 1400; "ODBC driver initialization failed; make sure the ODBC drivers are properly installed";
			num = 1401; "Failed to allocate environment (ODBC)";
			num = 1402; "Failed to free environment (ODBC)";
			num = 1403; "Failed to disconnect (ODBC)";
			num = 1404; "Failed to allocate connection (ODBC)";
			num = 1405; "Failed to free connection (ODBC)";
			num = 1406; "Failed check for SQL API (ODBC)";
			num = 1407; "Failed to allocate statement (ODBC)";
			num = 1408; "Extended error (ODBC)";
			num = 1409; "Error (ODBC)";
			num = 1413; "Failed communication link (ODBC)";
			num = 1450; "Action requires PHP privilege extension (*)";
			num = 1451; "Action requires that current file be remote";
			num = 1501; "SMTP authentication failed";
			num = 1502; "Connection refused by SMTP server";
			num = 1503; "Error with SSL";
			num = 1504; "SMTP server requires the connection to be encrypted";
			num = 1505; "Specified authentication is not supported by SMTP server";
			num = 1506; "Email(s) could not be sent successfully";
			num = 1507; "Unable to log in to the SMTP server"
		);

	type = "app"; </Chunk><Chunk type="FunctionRef">// you can use your own ~ErrorApplication (private function) for app errors
</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef"> (
			num = 100; "My custom app error";
			num = 200; "Another custom app error";
			"Unknown error"
		);

	type = "plugin"; </Chunk><Chunk type="FunctionRef">// you can use your own ~ErrorPlugins (private function) for plugin errors
</Chunk><Chunk type="NoRef">		"Add plugin specific handling here";

	"Unknown error"
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="11" functionArity="1" visible="True" parameters="field" name="FieldTableName"><Calculation><![CDATA[
GetValue(
   Substitute ( GetFieldName(field) ; "::" ; "¶" );
   1
)]]></Calculation><DisplayCalculation><Chunk type="NoRef"/><Chunk type="FunctionRef">GetValue</Chunk><Chunk type="NoRef">(
   </Chunk><Chunk type="FunctionRef">Substitute</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">GetFieldName</Chunk><Chunk type="NoRef">(field) ; "::" ; "¶" );
   1
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="12" functionArity="0" visible="True" parameters="" name="GetAccountName"><Calculation><![CDATA[/*Account::Name*/]]></Calculation><DisplayCalculation><Chunk type="NoRef">/*Account::Name*/</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="13" functionArity="1" visible="True" parameters="theError" name="IsError"><Calculation><![CDATA[Case (
	IsEmpty ( ErrorData ) ;  GetAsBoolean ( Get ( LastError ) ) ;

	Let ( [
			e = theError ;
			p1 = Position ( e ; "errorCode" ; 1 ; 1 ) ;
			p1 = Position ( e ; "=" ; p1 ; 1 ) + 1;
			pq = Position ( e ; "\\" ; p1 ; 1 ) ;
			p2 = Position ( e ; ";" ; p1 ; 1 ) ;
			ErrorData = Case( pq > p1 and pq < p2; Evaluate ( Quote(Middle ( e ; p1 ; p2 - p1 )) ); Evaluate ( Middle ( e ; p1 ; p2 - p1 )) )
		] ;
		GetAsBoolean ( ErrorData )
	)

)]]></Calculation><DisplayCalculation><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef"> (
	</Chunk><Chunk type="FunctionRef">IsEmpty</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="CustomFunctionRef">ErrorData</Chunk><Chunk type="NoRef"> ) ;  </Chunk><Chunk type="FunctionRef">GetAsBoolean</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">LastError</Chunk><Chunk type="NoRef"> ) ) ;

	</Chunk><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> ( [
			e = theError ;
			p1 = </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef"> ( e ; "errorCode" ; 1 ; 1 ) ;
			p1 = </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef"> ( e ; "=" ; p1 ; 1 ) + 1;
			pq = </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef"> ( e ; "\\" ; p1 ; 1 ) ;
			p2 = </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef"> ( e ; ";" ; p1 ; 1 ) ;
			</Chunk><Chunk type="CustomFunctionRef">ErrorData</Chunk><Chunk type="NoRef"> = </Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef">( pq > p1 </Chunk><Chunk type="FunctionRef">and</Chunk><Chunk type="NoRef"> pq < p2; </Chunk><Chunk type="FunctionRef">Evaluate</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Quote</Chunk><Chunk type="NoRef">(</Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef"> ( e ; p1 ; p2 - p1 )) ); </Chunk><Chunk type="FunctionRef">Evaluate</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef"> ( e ; p1 ; p2 - p1 )) )
		] ;
		</Chunk><Chunk type="FunctionRef">GetAsBoolean</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="CustomFunctionRef">ErrorData</Chunk><Chunk type="NoRef"> )
	)

)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="14" functionArity="0" visible="True" parameters="" name="LayoutGetID"><Calculation><![CDATA[GetValue(
   LayoutIDs ( Get(FileName) );
   Get(LayoutNumber)
)]]></Calculation><DisplayCalculation><Chunk type="FunctionRef">GetValue</Chunk><Chunk type="NoRef">(
   </Chunk><Chunk type="FunctionRef">LayoutIDs</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef">(</Chunk><Chunk type="FunctionRef">FileName</Chunk><Chunk type="NoRef">) );
   </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef">(</Chunk><Chunk type="FunctionRef">LayoutNumber</Chunk><Chunk type="NoRef">)
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="15" functionArity="1" visible="True" parameters="ID" name="LayoutGetNumberByID"><Calculation><![CDATA[Let(
[

ids = LayoutIDs ( Get(FileName) ) & "¶";
p = Position(ids; ID & "¶" ;1;1);
ids = Left(ids; p)
];
Case(
  ID = ""; "";
  p= 0; "";
  ValueCount(ids)
)
)]]></Calculation><DisplayCalculation><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef">(
[

ids = </Chunk><Chunk type="FunctionRef">LayoutIDs</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef">(</Chunk><Chunk type="FunctionRef">FileName</Chunk><Chunk type="NoRef">) ) & "¶";
p = </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">(ids; ID & "¶" ;1;1);
ids = </Chunk><Chunk type="FunctionRef">Left</Chunk><Chunk type="NoRef">(ids; p)
];
</Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef">(
  ID = ""; "";
  p= 0; "";
  </Chunk><Chunk type="FunctionRef">ValueCount</Chunk><Chunk type="NoRef">(ids)
)
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="16" functionArity="1" visible="True" parameters="layoutReference" name="LayoutGetNumberByReference"><Calculation><![CDATA[/*/*
 * =====================================================
 * GetLayoutNumberByReference ( layoutReference )
 *
 * RETURNS:
 * 		The layout number corresponding to the layoutReferenceParameter
 *
 * PARAMETERS:
 *		layoutReference the layout reference literal string
 *
 * EXAMPLES:
 * 		GetLayoutNumberByReference("OrderDetail")
 *
 *
 * DEPENDENCIES:
 *		depends on a table that is used to store the list of RegisteredLayouts
 *
 * NOTES:
 *		This is way around the problem of not being able to reference Layouts in a way that doesn't break..
 * =====================================================
 *
 */

Let( [
referenceFieldName = GetFieldName(LayoutRegistry::layoutReference) ;
layoutIDFieldName = GetFieldName(LayoutRegistry::layoutID) ;

table =  GetValue( Substitute ( referenceFieldName ; "::" ; "¶" ); 1 );
referenceFieldName = "\"" &Substitute ( referenceFieldName ; "::" ; Quote(".") ) & "\"";
layoutIDFieldName = "\"" &Substitute ( layoutIDFieldName ; "::" ; Quote(".") ) & "\"";
sql  = "SELECT " & layoutIDFieldName & " FROM " & Quote(table) & " WHERE " &  referenceFieldName  &  " = ?";
layoutID = ExecuteSQL(sql; "";""; layoutReference)
];
LayoutGetNumberByID ( layoutID )

)*/]]></Calculation><DisplayCalculation><Chunk type="NoRef">/*/*
 * =====================================================
 * GetLayoutNumberByReference ( layoutReference )
 *
 * RETURNS:
 * 		The layout number corresponding to the layoutReferenceParameter
 *
 * PARAMETERS:
 *		layoutReference the layout reference literal string
 *
 * EXAMPLES:
 * 		GetLayoutNumberByReference("OrderDetail")
 *
 *
 * DEPENDENCIES:
 *		depends on a table that is used to store the list of RegisteredLayouts
 *
 * NOTES:
 *		This is way around the problem of not being able to reference Layouts in a way that doesn't break..
 * =====================================================
 *
 */

Let( [
referenceFieldName = GetFieldName(LayoutRegistry::layoutReference) ;
layoutIDFieldName = GetFieldName(LayoutRegistry::layoutID) ;

table =  GetValue( Substitute ( referenceFieldName ; "::" ; "¶" ); 1 );
referenceFieldName = "\"" &Substitute ( referenceFieldName ; "::" ; Quote(".") ) & "\"";
layoutIDFieldName = "\"" &Substitute ( layoutIDFieldName ; "::" ; Quote(".") ) & "\"";
sql  = "SELECT " & layoutIDFieldName & " FROM " & Quote(table) & " WHERE " &  referenceFieldName  &  " = ?";
layoutID = ExecuteSQL(sql; "";""; layoutReference)
];
LayoutGetNumberByID ( layoutID )

)*/</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="17" functionArity="0" visible="True" parameters="" name="OLD#AssignScriptParameters"><Calculation><![CDATA[/**
 * =====================================
 * #AssignScriptParameters
 *
 * PURPOSE:
 * #AssignScriptParameters uses the current script parameter (treated as if
 * generated by the # function) to declare and populate a series of
 * locally-scoped script variables. #AssignScriptParameters also uses the
 * current script name to determine whether or not all required named parameters
 * are populated (≠ Null). This function is NOT equivalent to
 * #Assign ( Get ( ScriptParameter ) ).
 *
 * RETURNS:
 * True (1) when the script parameter is a valid set of name-value pairs (which
 * includes the empty string) and all parameters defined as required according to
 * the script name are non-null; False (0) otherwise.
 *
 * PARAMETERS: none
 *
 * DEPENDENCIES: none
 *
 * NOTE:
 * To be accessible outside this function, variable declarations in the script
 * parameter must use the $- or $$-prefixed notation for FileMaker variables.
 * This function does not handle that for you.
 *
 * HISTORY:
 * MODIFIED on 2010-10-04 by jeremy@kyologic.com to return explicit True or
 * False values indicating successful evaluation of the script parameter, and to
 * fit syntax inspired by a comment on standards.filemakermagazine.com by
 * Richard Dyce.
 * CREATED on 2010-03-13 by Jeremy Bante of Kyo Logic (jeremy@kyologic.com).
 * INSPIRED by an example in the FileMaker help documentation.
 *
 * REFERENCES:
 * Script Parameter Interface Best Practice: http://filemakerstandards.org/pages/viewpage.action?pageId=557462
 * =====================================
 */

Let ( [
        ~evaluateString =
                "Let ( [¶"
                & Get ( ScriptParameter )
                & "$void = $void" //terminating variable to keep semicolon-delimited sytax in ScriptParameter consistent
                & "¶];¶"
                & "True¶)"
];

        Case(
                not IsValidExpression ( ~evaluateString );
                        False;

                //else, ~evaluateString is a valid expression, so check that required parameters are populated
                        Evaluate ( ~evaluateString )
                        and
                        Let ( [
                                //parse required parameters from script name
                                ~BEGIN = "("; //character marking beginning of named parameters
                                //~END = ")"; //character defining end of named parameters
                                ~DELIMITER = ","; //character delimiting between named parameters
                                ~OPTIONAL = "{"; //character marking beginning of optional parameters

                                ~parameters = Substitute ( Get ( ScriptName ) ; ["¶"; ""]; [" "; ""] );
                                ~beginParameters = Position ( ~parameters ; ~BEGIN ; 1 ; 1 );
                                ~endParameters = Position ( ~parameters ; ~OPTIONAL ; 1 ; 1 );
                                ~endParameters = Case ( not ~endParameters ; Length ( ~parameters ) ; ~endParameters );
                                ~parameters = Middle ( ~parameters ; ~beginParameters + 1 ; ~endParameters - ~beginParameters - 1 );
                                ~parameters =
                                        Substitute (
                                                Trim ( ~parameters ) & "☠";
                                                [ ~DELIMITER & "☠" ; "" ]; //remove possible erroneous trailing delimiter
                                                [ "☠" ; "" ];
                                                [ ~DELIMITER ; "¶" ]
                                        )
                        ];
                                //check that required parameters are non-null
                                Case (
                                        ~beginParameters and Length ( ~parameters ); //script name specifies parameters
                                                Evaluate ( //string returns true when all required parameters are populated
                                                        "Length ( $"
                                                        & Substitute ( ~parameters ; "¶" ; " ) and Length ( $" )
                                                        & " )"
                                                );

                                        //else, parameters are adequate by default
                                        True
                                )
                        )
        )
)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * =====================================
 * #AssignScriptParameters
 *
 * PURPOSE:
 * #AssignScriptParameters uses the current script parameter (treated as if
 * generated by the # function) to declare and populate a series of
 * locally-scoped script variables. #AssignScriptParameters also uses the
 * current script name to determine whether or not all required named parameters
 * are populated (≠ Null). This function is NOT equivalent to
 * #Assign ( Get ( ScriptParameter ) ).
 *
 * RETURNS:
 * True (1) when the script parameter is a valid set of name-value pairs (which
 * includes the empty string) and all parameters defined as required according to
 * the script name are non-null; False (0) otherwise.
 *
 * PARAMETERS: none
 *
 * DEPENDENCIES: none
 *
 * NOTE:
 * To be accessible outside this function, variable declarations in the script
 * parameter must use the $- or $$-prefixed notation for FileMaker variables.
 * This function does not handle that for you.
 *
 * HISTORY:
 * MODIFIED on 2010-10-04 by jeremy@kyologic.com to return explicit True or
 * False values indicating successful evaluation of the script parameter, and to
 * fit syntax inspired by a comment on standards.filemakermagazine.com by
 * Richard Dyce.
 * CREATED on 2010-03-13 by Jeremy Bante of Kyo Logic (jeremy@kyologic.com).
 * INSPIRED by an example in the FileMaker help documentation.
 *
 * REFERENCES:
 * Script Parameter Interface Best Practice: http://filemakerstandards.org/pages/viewpage.action?pageId=557462
 * =====================================
 */

</Chunk><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> ( [
        ~evaluateString =
                "Let ( [¶"
                & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">ScriptParameter</Chunk><Chunk type="NoRef"> )
                & "$void = $void" </Chunk><Chunk type="FunctionRef">//terminating variable to keep semicolon-delimited sytax in ScriptParameter consistent
</Chunk><Chunk type="NoRef">                & "¶];¶"
                & "True¶)"
];

        </Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef">(
                </Chunk><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">IsValidExpression</Chunk><Chunk type="NoRef"> ( ~evaluateString );
                        </Chunk><Chunk type="FunctionRef">False</Chunk><Chunk type="NoRef">;

                </Chunk><Chunk type="FunctionRef">//else, ~evaluateString is a valid expression, so check that required parameters are populated
</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">Evaluate</Chunk><Chunk type="NoRef"> ( ~evaluateString )
                        </Chunk><Chunk type="FunctionRef">and</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> ( [
                                </Chunk><Chunk type="FunctionRef">//parse required parameters from script name
</Chunk><Chunk type="NoRef">                                ~BEGIN = "("; </Chunk><Chunk type="FunctionRef">//character marking beginning of named parameters
</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">//~END = ")"; //character defining end of named parameters
</Chunk><Chunk type="NoRef">                                ~DELIMITER = ","; </Chunk><Chunk type="FunctionRef">//character delimiting between named parameters
</Chunk><Chunk type="NoRef">                                ~OPTIONAL = "{"; </Chunk><Chunk type="FunctionRef">//character marking beginning of optional parameters
</Chunk><Chunk type="NoRef">
                                ~parameters = </Chunk><Chunk type="FunctionRef">Substitute</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">ScriptName</Chunk><Chunk type="NoRef"> ) ; ["¶"; ""]; [" "; ""] );
                                ~beginParameters = </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef"> ( ~parameters ; ~BEGIN ; 1 ; 1 );
                                ~endParameters = </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef"> ( ~parameters ; ~OPTIONAL ; 1 ; 1 );
                                ~endParameters = </Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"> ~endParameters ; </Chunk><Chunk type="FunctionRef">Length</Chunk><Chunk type="NoRef"> ( ~parameters ) ; ~endParameters );
                                ~parameters = </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef"> ( ~parameters ; ~beginParameters + 1 ; ~endParameters - ~beginParameters - 1 );
                                ~parameters =
                                        </Chunk><Chunk type="FunctionRef">Substitute</Chunk><Chunk type="NoRef"> (
                                                </Chunk><Chunk type="FunctionRef">Trim</Chunk><Chunk type="NoRef"> ( ~parameters ) & "☠";
                                                [ ~DELIMITER & "☠" ; "" ]; </Chunk><Chunk type="FunctionRef">//remove possible erroneous trailing delimiter
</Chunk><Chunk type="NoRef">                                                [ "☠" ; "" ];
                                                [ ~DELIMITER ; "¶" ]
                                        )
                        ];
                                </Chunk><Chunk type="FunctionRef">//check that required parameters are non-null
</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef"> (
                                        ~beginParameters </Chunk><Chunk type="FunctionRef">and</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">Length</Chunk><Chunk type="NoRef"> ( ~parameters ); </Chunk><Chunk type="FunctionRef">//script name specifies parameters
</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">Evaluate</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">//string returns true when all required parameters are populated
</Chunk><Chunk type="NoRef">                                                        "Length ( $"
                                                        & </Chunk><Chunk type="FunctionRef">Substitute</Chunk><Chunk type="NoRef"> ( ~parameters ; "¶" ; " ) and Length ( $" )
                                                        & " )"
                                                );

                                        </Chunk><Chunk type="FunctionRef">//else, parameters are adequate by default
</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">True</Chunk><Chunk type="NoRef">
                                )
                        )
        )
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="18" functionArity="0" visible="True" parameters="" name="OLD#AssignScriptResults"><Calculation><![CDATA[/**
 * =====================================
 * #AssignScriptResults
 *
 * PURPOSE:
 * #AssignScriptResults uses the current script result (treated as if generated
 * by the # function) to declare and populate a series of locally-scoped script
 * variables. This function is equivalent to #Assign ( Get ( ScriptResult ) ).
 *
 * RETURNS:
 * True (1) when the script result is a valid set of name-value pairs (which
 * includes the empty string); False (0) otherwise.
 *
 * PARAMETERS: none
 *
 * DEPENDENCIES: none
 *
 * NOTE:
 * To be accessible outside this function, variable declarations in the script
 * result must use the $- or $$-prefixed notation for FileMaker variables.
 * This function does not handle that for you.
 *
 * HISTORY:
 * MODIFIED on 2010-10-04 by jeremy@kyologic.com to return explicit True or
 * False values indicating successful evaluation of the script result, and to
 * fit syntax inspired by a comment on standards.filemakermagazine.com by
 * Richard Dyce.
 * CREATED on 2010-08-25 by Jeremy Bante of Kyo Logic (jeremy@kyologic.com).
 * INSPIRED by an example in the FileMaker help documentation.
 *
 * REFERENCES:
 * Script Parameter Interface Best Practice: http://filemakerstandards.org/pages/viewpage.action?pageId=557462
 * =====================================
 */

Let (
        ~evaluateString = //string to evaluate to declare variables
                "Let ( [¶"
                & Get ( ScriptResult )
                & "$void = $void" //terminating variable to keep semicolon-delimited sytax in variableString consistent
                & "¶];¶"
                & "True¶)";

        //end variable definitions

        Case (
                IsValidExpression ( ~evaluateString );
                        Evaluate ( ~evaluateString );

                //else, ~evaluateString is not a valid expression...
                        False //return error
        )
)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * =====================================
 * #AssignScriptResults
 *
 * PURPOSE:
 * #AssignScriptResults uses the current script result (treated as if generated
 * by the # function) to declare and populate a series of locally-scoped script
 * variables. This function is equivalent to #Assign ( Get ( ScriptResult ) ).
 *
 * RETURNS:
 * True (1) when the script result is a valid set of name-value pairs (which
 * includes the empty string); False (0) otherwise.
 *
 * PARAMETERS: none
 *
 * DEPENDENCIES: none
 *
 * NOTE:
 * To be accessible outside this function, variable declarations in the script
 * result must use the $- or $$-prefixed notation for FileMaker variables.
 * This function does not handle that for you.
 *
 * HISTORY:
 * MODIFIED on 2010-10-04 by jeremy@kyologic.com to return explicit True or
 * False values indicating successful evaluation of the script result, and to
 * fit syntax inspired by a comment on standards.filemakermagazine.com by
 * Richard Dyce.
 * CREATED on 2010-08-25 by Jeremy Bante of Kyo Logic (jeremy@kyologic.com).
 * INSPIRED by an example in the FileMaker help documentation.
 *
 * REFERENCES:
 * Script Parameter Interface Best Practice: http://filemakerstandards.org/pages/viewpage.action?pageId=557462
 * =====================================
 */

</Chunk><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> (
        ~evaluateString = </Chunk><Chunk type="FunctionRef">//string to evaluate to declare variables
</Chunk><Chunk type="NoRef">                "Let ( [¶"
                & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">ScriptResult</Chunk><Chunk type="NoRef"> )
                & "$void = $void" </Chunk><Chunk type="FunctionRef">//terminating variable to keep semicolon-delimited sytax in variableString consistent
</Chunk><Chunk type="NoRef">                & "¶];¶"
                & "True¶)";

        </Chunk><Chunk type="FunctionRef">//end variable definitions
</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef"> (
                </Chunk><Chunk type="FunctionRef">IsValidExpression</Chunk><Chunk type="NoRef"> ( ~evaluateString );
                        </Chunk><Chunk type="FunctionRef">Evaluate</Chunk><Chunk type="NoRef"> ( ~evaluateString );

                </Chunk><Chunk type="FunctionRef">//else, ~evaluateString is not a valid expression...
</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">False</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">//return error
</Chunk><Chunk type="NoRef">        )
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="19" functionArity="2" visible="True" parameters="portalObject;rowObject" name="PortalLastRow"><Calculation><![CDATA[Let ( [

		~pr = Get ( ActivePortalRowNumber ) ;
		~pr = Case(~pr = 0; 2; ~pr);

		~rowHeight = GetLayoutObjectAttribute ( rowObject ; "top" ; "" ; ~pr ) -
			GetLayoutObjectAttribute ( rowObject ; "top" ; "" ; ~pr - 1 ) ;

		~distance = GetLayoutObjectAttribute ( portalObject ; "bottom" ) -
			GetLayoutObjectAttribute ( rowObject ; "bottom" ; "" ; ~pr )
	] ;

	Case(
		~rowHeight <= 0; 0 ;
		~pr + ( ~distance / ~rowHeight )
	)

)]]></Calculation><DisplayCalculation><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> ( [

		~pr = </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">ActivePortalRowNumber</Chunk><Chunk type="NoRef"> ) ;
		~pr = </Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef">(~pr = 0; 2; ~pr);

		~rowHeight = </Chunk><Chunk type="FunctionRef">GetLayoutObjectAttribute</Chunk><Chunk type="NoRef"> ( rowObject ; "top" ; "" ; ~pr ) -
			</Chunk><Chunk type="FunctionRef">GetLayoutObjectAttribute</Chunk><Chunk type="NoRef"> ( rowObject ; "top" ; "" ; ~pr - 1 ) ;

		~distance = </Chunk><Chunk type="FunctionRef">GetLayoutObjectAttribute</Chunk><Chunk type="NoRef"> ( portalObject ; "bottom" ) -
			</Chunk><Chunk type="FunctionRef">GetLayoutObjectAttribute</Chunk><Chunk type="NoRef"> ( rowObject ; "bottom" ; "" ; ~pr )
	] ;

	</Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef">(
		~rowHeight <= 0; 0 ;
		~pr + ( ~distance / ~rowHeight )
	)

)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="20" functionArity="1" visible="True" parameters="field" name="SQLField"><Calculation><![CDATA[/*
returns the FieldName as a fully qualified SQL name

*/

 "\"" &Substitute ( GetFieldName(field) ; "::" ; Quote(".") ) & "\""]]></Calculation><DisplayCalculation><Chunk type="NoRef">/*
returns the FieldName as a fully qualified SQL name

*/

 "\"" &</Chunk><Chunk type="FunctionRef">Substitute</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">GetFieldName</Chunk><Chunk type="NoRef">(field) ; "::" ; </Chunk><Chunk type="FunctionRef">Quote</Chunk><Chunk type="NoRef">(".") ) & "\""</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="21" functionArity="3" visible="True" parameters="field;searchField;searchValue" name="SQLSelectColumn"><Calculation><![CDATA[Let(
[

sql =
"SELECT " &
SQLField ( field  ) &
" FROM " & Quote(
GetValue(
   Substitute ( GetFieldName(field) ; "::" ; "¶" );
   1
) )&
" WHERE " &
SQLField ( searchField ) &
 " = ?"

];

ExecuteSQL(

   sql;

   "";"";

   searchValue

)
)]]></Calculation><DisplayCalculation><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef">(
[

sql =
"SELECT " &
</Chunk><Chunk type="CustomFunctionRef">SQLField</Chunk><Chunk type="NoRef"> ( field  ) &
" FROM " & </Chunk><Chunk type="FunctionRef">Quote</Chunk><Chunk type="NoRef">(
</Chunk><Chunk type="FunctionRef">GetValue</Chunk><Chunk type="NoRef">(
   </Chunk><Chunk type="FunctionRef">Substitute</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">GetFieldName</Chunk><Chunk type="NoRef">(field) ; "::" ; "¶" );
   1
) )&
" WHERE " &
</Chunk><Chunk type="CustomFunctionRef">SQLField</Chunk><Chunk type="NoRef"> ( searchField ) &
 " = ?"

];

</Chunk><Chunk type="FunctionRef">ExecuteSQL</Chunk><Chunk type="NoRef">(

   sql;

   "";"";

   searchValue

)
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="22" functionArity="1" visible="True" parameters="field" name="SQLTable"><Calculation><![CDATA[Quote(
GetValue(
   Substitute ( GetFieldName(field) ; "::" ; "¶" );
   1
)
)]]></Calculation><DisplayCalculation><Chunk type="FunctionRef">Quote</Chunk><Chunk type="NoRef">(
</Chunk><Chunk type="FunctionRef">GetValue</Chunk><Chunk type="NoRef">(
   </Chunk><Chunk type="FunctionRef">Substitute</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">GetFieldName</Chunk><Chunk type="NoRef">(field) ; "::" ; "¶" );
   1
)
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="23" functionArity="1" visible="True" parameters="theField" name="testCF"><Calculation><![CDATA[GetFieldName(theField)]]></Calculation><DisplayCalculation><Chunk type="FunctionRef">GetFieldName</Chunk><Chunk type="NoRef">(theField)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="24" functionArity="0" visible="True" parameters="" name="TriggersAreActive"><Calculation><![CDATA[/**
 * =====================================
 * TriggersAreActive
 *
 * PURPOSE:
 * TriggersAreActive checks a global variable to identify whether or not script
 * triggers should be allowed to run. This function is best used in concert with
 * the TriggersDisable, TriggersEnable, and TriggersReset
 * functions.
 *
 * RETURNS:
 * False (0) if triggers should be suppressed; True (1) otherwise.
 *
 * PARAMETERS: none
 *
 * REFERENCED VARIABLES:
 * $$~DISABLETRIGGERS
 *
 * DEPENDENCIES: none
 *
 * EXAMPLE (triggered script):
 * If [ TriggersAreActive ]
 *        # Do something
 * End If
 *
 * HISTORY:
 * MODIFIED on 2010-12-13 by jbante@supportgroup.com to use names suggested at
 * filemakerstandards.org.
 * CREATED on 2010-12-12 by Jeremy Bante of The Support Group (jbante@supportgroup.com).
 *
 * REFERENCES:
 * Supressible Triggered Scripts Best Practice: http://filemakerstandards.org/display/bp/Suppressible+Triggered+Scripts
 * =====================================
 */
not $$~DISABLETRIGGERS]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * =====================================
 * TriggersAreActive
 *
 * PURPOSE:
 * TriggersAreActive checks a global variable to identify whether or not script
 * triggers should be allowed to run. This function is best used in concert with
 * the TriggersDisable, TriggersEnable, and TriggersReset
 * functions.
 *
 * RETURNS:
 * False (0) if triggers should be suppressed; True (1) otherwise.
 *
 * PARAMETERS: none
 *
 * REFERENCED VARIABLES:
 * $$~DISABLETRIGGERS
 *
 * DEPENDENCIES: none
 *
 * EXAMPLE (triggered script):
 * If [ TriggersAreActive ]
 *        # Do something
 * End If
 *
 * HISTORY:
 * MODIFIED on 2010-12-13 by jbante@supportgroup.com to use names suggested at
 * filemakerstandards.org.
 * CREATED on 2010-12-12 by Jeremy Bante of The Support Group (jbante@supportgroup.com).
 *
 * REFERENCES:
 * Supressible Triggered Scripts Best Practice: http://filemakerstandards.org/display/bp/Suppressible+Triggered+Scripts
 * =====================================
 */
</Chunk><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"> $$~DISABLETRIGGERS</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="25" functionArity="0" visible="True" parameters="" name="TriggersDisable"><Calculation><![CDATA[/**
 * =====================================
 * TriggersDisable
 *
 * PURPOSE:
 * TriggersDisable sets global variables to indicate that the current script is
 * suppressing triggers. This script must be called from the context of a
 * script; otherwise, it will not suppress triggers, and it will return False.
 * In order to be suppressed, a script called via trigger should use the
 * TriggersAreActive function to decide whether or not to run.
 *
 * RETURNS:
 * True (1) if called from the context of a script, and therefore triggers have
 * been suppressed; False (0) otherwise.
 *
 * PARAMETERS: none
 *
 * REFERENCED VARIABLES:
 * $$~DISABLETRIGGERS
 * $$~DISABLETRIGGERS.SCRIPTS
 *
 * DEPENDENCIES: none
 *
 * EXAMPLE (script):
 * Set Variable [ $ignoreMe ; TriggersDisable ]
 *        # Do something
 * Set Variable [ $ignoreMe ; TriggersEnable ]
 *
 * NOTES:
 * This function should *always* be used in pairs with the TriggersEnable
 * function.
 *
 * HISTORY:
 * MODIFIED on 2010-12-13 by jbante@supportgroup.com to use names suggested at
 * filemakerstandards.org.
 * CREATED on 2010-12-12 by Jeremy Bante of The Support Group (jbante@supportgroup.com).
 *
 * REFERENCES:
 * Supressible Triggered Scripts Best Practice: http://filemakerstandards.org/display/bp/Suppressible+Triggered+Scripts
 * =====================================
 */

Let ( [
        ~scriptName = Get ( ScriptName );
        ~scriptIsRunning = not IsEmpty ( ~scriptName );
        $$~DISABLETRIGGERS.SCRIPTS =
                If ( ~scriptIsRunning;
                        ~scriptName & "¶" & $$~DISABLETRIGGERS.SCRIPTS;
                        /*else*/ $$~DISABLETRIGGERS.SCRIPTS
                );
        $$~DISABLETRIGGERS =
                If ( ~scriptIsRunning;
                        True;
                        /*else*/ $$~DISABLETRIGGERS
                )
];
        ~scriptIsRunning
)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * =====================================
 * TriggersDisable
 *
 * PURPOSE:
 * TriggersDisable sets global variables to indicate that the current script is
 * suppressing triggers. This script must be called from the context of a
 * script; otherwise, it will not suppress triggers, and it will return False.
 * In order to be suppressed, a script called via trigger should use the
 * TriggersAreActive function to decide whether or not to run.
 *
 * RETURNS:
 * True (1) if called from the context of a script, and therefore triggers have
 * been suppressed; False (0) otherwise.
 *
 * PARAMETERS: none
 *
 * REFERENCED VARIABLES:
 * $$~DISABLETRIGGERS
 * $$~DISABLETRIGGERS.SCRIPTS
 *
 * DEPENDENCIES: none
 *
 * EXAMPLE (script):
 * Set Variable [ $ignoreMe ; TriggersDisable ]
 *        # Do something
 * Set Variable [ $ignoreMe ; TriggersEnable ]
 *
 * NOTES:
 * This function should *always* be used in pairs with the TriggersEnable
 * function.
 *
 * HISTORY:
 * MODIFIED on 2010-12-13 by jbante@supportgroup.com to use names suggested at
 * filemakerstandards.org.
 * CREATED on 2010-12-12 by Jeremy Bante of The Support Group (jbante@supportgroup.com).
 *
 * REFERENCES:
 * Supressible Triggered Scripts Best Practice: http://filemakerstandards.org/display/bp/Suppressible+Triggered+Scripts
 * =====================================
 */

</Chunk><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> ( [
        ~scriptName = </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">ScriptName</Chunk><Chunk type="NoRef"> );
        ~scriptIsRunning = </Chunk><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">IsEmpty</Chunk><Chunk type="NoRef"> ( ~scriptName );
        $$~DISABLETRIGGERS.SCRIPTS =
                </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( ~scriptIsRunning;
                        ~scriptName & "¶" & $$~DISABLETRIGGERS.SCRIPTS;
                        /*else*/ $$~DISABLETRIGGERS.SCRIPTS
                );
        $$~DISABLETRIGGERS =
                </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( ~scriptIsRunning;
                        </Chunk><Chunk type="FunctionRef">True</Chunk><Chunk type="NoRef">;
                        /*else*/ $$~DISABLETRIGGERS
                )
];
        ~scriptIsRunning
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="26" functionArity="0" visible="True" parameters="" name="TriggersEnable"><Calculation><![CDATA[/**
 * =====================================
 * TriggersEnable
 *
 * PURPOSE:
 * TriggersEnable sets global variables to indicate that the current script is
 * no longer suppressing triggers. This function will also turn off trigger
 * suppression altogether if there are no other scripts suppressing triggers. In
 * order to be suppressed, a script called via trigger should use the
 * TriggersAreActive function to decide whether or not to run.
 *
 * RETURNS:
 * True (1) if TriggersEnable successfully removed the current script from
 * the list of scripts suppressing triggers; False (0) otherwise.
 *
 * PARAMETERS: none
 *
 * REFERENCED VARIABLES:
 * $$~DISABLETRIGGERS
 * $$~DISABLETRIGGERS.SCRIPTS
 *
 * DEPENDENCIES: none
 *
 * EXAMPLE (script):
 * Set Variable [ $ignoreMe ; TriggersDisable ]
 *        # Do something
 * Set Variable [ $ignoreMe ; TriggersEnable ]
 *
 * NOTES:
 * This function should *always* be used in pairs with the TriggersDisable
 * function.
 *
 * HISTORY:
 * MODIFIED on 2010-12-13 by jbante@supportgroup.com to use names suggested at
 * filemakerstandards.org.
 * CREATED on 2010-12-12 by Jeremy Bante of The Support Group (jbante@supportgroup.com).
 *
 * REFERENCES:
 * Supressible Triggered Scripts Best Practice: http://filemakerstandards.org/display/bp/Suppressible+Triggered+Scripts
 * =====================================
 */

Let ( [
        ~lastScript = GetValue ( $$~DISABLETRIGGERS.SCRIPTS ; 1 );
        ~enableTriggers = Get ( ScriptName ) = ~lastScript; //boolean indicating script name match
        $$~DISABLETRIGGERS.SCRIPTS =
                If ( ~enableTriggers;
                        RightValues (
                        	$$~DISABLETRIGGERS.SCRIPTS;
                        	ValueCount ( $$~DISABLETRIGGERS.SCRIPTS ) - 1
                        );
                        /*else*/ $$~DISABLETRIGGERS.SCRIPTS
                );
        ~scriptCount = ValueCount ( $$~DISABLETRIGGERS.SCRIPTS );
        $$~DISABLETRIGGERS = If ( ~scriptCount ; True ; /*else*/ "" )
];
        ~enableTriggers or not ~scriptCount //ScriptName was found and removed, or there are no suppressing scripts
)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * =====================================
 * TriggersEnable
 *
 * PURPOSE:
 * TriggersEnable sets global variables to indicate that the current script is
 * no longer suppressing triggers. This function will also turn off trigger
 * suppression altogether if there are no other scripts suppressing triggers. In
 * order to be suppressed, a script called via trigger should use the
 * TriggersAreActive function to decide whether or not to run.
 *
 * RETURNS:
 * True (1) if TriggersEnable successfully removed the current script from
 * the list of scripts suppressing triggers; False (0) otherwise.
 *
 * PARAMETERS: none
 *
 * REFERENCED VARIABLES:
 * $$~DISABLETRIGGERS
 * $$~DISABLETRIGGERS.SCRIPTS
 *
 * DEPENDENCIES: none
 *
 * EXAMPLE (script):
 * Set Variable [ $ignoreMe ; TriggersDisable ]
 *        # Do something
 * Set Variable [ $ignoreMe ; TriggersEnable ]
 *
 * NOTES:
 * This function should *always* be used in pairs with the TriggersDisable
 * function.
 *
 * HISTORY:
 * MODIFIED on 2010-12-13 by jbante@supportgroup.com to use names suggested at
 * filemakerstandards.org.
 * CREATED on 2010-12-12 by Jeremy Bante of The Support Group (jbante@supportgroup.com).
 *
 * REFERENCES:
 * Supressible Triggered Scripts Best Practice: http://filemakerstandards.org/display/bp/Suppressible+Triggered+Scripts
 * =====================================
 */

</Chunk><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> ( [
        ~lastScript = </Chunk><Chunk type="FunctionRef">GetValue</Chunk><Chunk type="NoRef"> ( $$~DISABLETRIGGERS.SCRIPTS ; 1 );
        ~enableTriggers = </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">ScriptName</Chunk><Chunk type="NoRef"> ) = ~lastScript; </Chunk><Chunk type="FunctionRef">//boolean indicating script name match
</Chunk><Chunk type="NoRef">        $$~DISABLETRIGGERS.SCRIPTS =
                </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( ~enableTriggers;
                        </Chunk><Chunk type="FunctionRef">RightValues</Chunk><Chunk type="NoRef"> (
                        	$$~DISABLETRIGGERS.SCRIPTS;
                        	</Chunk><Chunk type="FunctionRef">ValueCount</Chunk><Chunk type="NoRef"> ( $$~DISABLETRIGGERS.SCRIPTS ) - 1
                        );
                        /*else*/ $$~DISABLETRIGGERS.SCRIPTS
                );
        ~scriptCount = </Chunk><Chunk type="FunctionRef">ValueCount</Chunk><Chunk type="NoRef"> ( $$~DISABLETRIGGERS.SCRIPTS );
        $$~DISABLETRIGGERS = </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( ~scriptCount ; </Chunk><Chunk type="FunctionRef">True</Chunk><Chunk type="NoRef"> ; /*else*/ "" )
];
        ~enableTriggers </Chunk><Chunk type="FunctionRef">or</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"> ~scriptCount </Chunk><Chunk type="FunctionRef">//ScriptName was found and removed, or there are no suppressing scripts
</Chunk><Chunk type="NoRef">)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="27" functionArity="0" visible="True" parameters="" name="TriggersReset"><Calculation><![CDATA[/**
 * =====================================
 * TriggersReset
 *
 * PURPOSE:
 * TriggersReset sets global variables to indicate that script triggers should
 * be allowed to run, regardless of any persisting instructions to the contrary
 * from any script. This may be useful to recover from a situation where a
 * script forgot to call TriggersEnable at the end of operation. In order to be
 * suppressed, a script called via trigger should use the TriggersAreActive
 * function to decide whether or not to run.
 *
 * RETURNS: "" (null)
 *
 * PARAMETERS: none
 *
 * REFERENCED VARIABLES:
 * $$~DISABLETRIGGERS
 * $$~DISABLETRIGGERS.SCRIPTS
 *
 * DEPENDENCIES: none
 *
 * HISTORY:
 * MODIFIED on 2010-12-13 by jbante@supportgroup.com to use names suggested at
 * filemakerstandards.org.
 * CREATED on 2010-12-12 by Jeremy Bante of The Support Group (jbante@supportgroup.com).
 *
 * REFERENCES:
 * Supressible Triggered Scripts Best Practice: http://filemakerstandards.org/display/bp/Suppressible+Triggered+Scripts
 * =====================================
 */

Let ( [
        $$~DISABLETRIGGERS.SCRIPTS = "";
        $$~DISABLETRIGGERS = ""
];
        ""
)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * =====================================
 * TriggersReset
 *
 * PURPOSE:
 * TriggersReset sets global variables to indicate that script triggers should
 * be allowed to run, regardless of any persisting instructions to the contrary
 * from any script. This may be useful to recover from a situation where a
 * script forgot to call TriggersEnable at the end of operation. In order to be
 * suppressed, a script called via trigger should use the TriggersAreActive
 * function to decide whether or not to run.
 *
 * RETURNS: "" (null)
 *
 * PARAMETERS: none
 *
 * REFERENCED VARIABLES:
 * $$~DISABLETRIGGERS
 * $$~DISABLETRIGGERS.SCRIPTS
 *
 * DEPENDENCIES: none
 *
 * HISTORY:
 * MODIFIED on 2010-12-13 by jbante@supportgroup.com to use names suggested at
 * filemakerstandards.org.
 * CREATED on 2010-12-12 by Jeremy Bante of The Support Group (jbante@supportgroup.com).
 *
 * REFERENCES:
 * Supressible Triggered Scripts Best Practice: http://filemakerstandards.org/display/bp/Suppressible+Triggered+Scripts
 * =====================================
 */

</Chunk><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> ( [
        $$~DISABLETRIGGERS.SCRIPTS = "";
        $$~DISABLETRIGGERS = ""
];
        ""
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="28" functionArity="0" visible="True" parameters="" name="UUIDDecimal"><Calculation><![CDATA[/**
 * Converts the results of the Get(UUID) function into a Decimal for better indexing
 *
 *
 * @author Todd Geist, todd@geistinteractive.com
 * @created 10/19/2012
 */

Let(

[

h = "0123456789ABCDEF";

 t =    Filter( Get(UUID); h);

n =

( Position( h; Middle( t; 1; 1) ;1;1)-1) * ( 16 ^ 31 ) +
( Position( h; Middle( t; 2; 1) ;1;1)-1) * ( 16 ^ 30 ) +
( Position( h; Middle( t; 3; 1) ;1;1)-1) * ( 16 ^ 29 ) +
( Position( h; Middle( t; 4; 1) ;1;1)-1) * ( 16 ^ 28 ) +
( Position( h; Middle( t; 5; 1) ;1;1)-1) * ( 16 ^ 27 ) +
( Position( h; Middle( t; 6; 1) ;1;1)-1) * ( 16 ^ 26 ) +
( Position( h; Middle( t; 7; 1) ;1;1)-1) * ( 16 ^ 25 ) +
( Position( h; Middle( t; 8; 1) ;1;1)-1) * ( 16 ^ 24 ) +
( Position( h; Middle( t; 9; 1) ;1;1)-1) * ( 16 ^ 23 ) +
( Position( h; Middle( t; 10; 1) ;1;1)-1) * ( 16 ^ 22 ) +
( Position( h; Middle( t; 11; 1) ;1;1)-1) * ( 16 ^ 21 ) +
( Position( h; Middle( t; 12; 1) ;1;1)-1) * ( 16 ^ 20 ) +
( Position( h; Middle( t; 13; 1) ;1;1)-1) * ( 16 ^ 19 ) +
( Position( h; Middle( t; 14; 1) ;1;1)-1) * ( 16 ^ 18 ) +
( Position( h; Middle( t; 15; 1) ;1;1)-1) * ( 16 ^ 17 ) +
( Position( h; Middle( t; 16; 1) ;1;1)-1) * ( 16 ^ 16 ) +
( Position( h; Middle( t; 17; 1) ;1;1)-1) * ( 16 ^ 15 ) +
( Position( h; Middle( t; 18; 1) ;1;1)-1) * ( 16 ^ 14 ) +
( Position( h; Middle( t; 19; 1) ;1;1)-1) * ( 16 ^ 13 ) +
( Position( h; Middle( t; 20; 1) ;1;1)-1) * ( 16 ^ 12 ) +
( Position( h; Middle( t; 21; 1) ;1;1)-1) * ( 16 ^ 11 ) +
( Position( h; Middle( t; 22; 1) ;1;1)-1) * ( 16 ^ 10 ) +
( Position( h; Middle( t; 23; 1) ;1;1)-1) * ( 16 ^ 9 ) +
( Position( h; Middle( t; 24; 1) ;1;1)-1) * ( 16 ^ 8 ) +
( Position( h; Middle( t; 25; 1) ;1;1)-1) * ( 16 ^ 7 ) +
( Position( h; Middle( t; 26; 1) ;1;1)-1) * ( 16 ^ 6 ) +
( Position( h; Middle( t; 27; 1) ;1;1)-1) * ( 16 ^ 5 ) +
( Position( h; Middle( t; 28; 1) ;1;1)-1) * ( 16 ^ 4 ) +
( Position( h; Middle( t; 29; 1) ;1;1)-1) * ( 16 ^ 3 ) +
( Position( h; Middle( t; 30; 1) ;1;1)-1) * ( 16 ^ 2 ) +
( Position( h; Middle( t; 31; 1) ;1;1)-1) * ( 16 ^ 1 ) +
( Position( h; Middle( t; 32; 1) ;1;1)-1)

];

n

)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * Converts the results of the Get(UUID) function into a Decimal for better indexing
 *
 *
 * @author Todd Geist, todd@geistinteractive.com
 * @created 10/19/2012
 */

</Chunk><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef">(

[

h = "0123456789ABCDEF";

 t =    </Chunk><Chunk type="FunctionRef">Filter</Chunk><Chunk type="NoRef">( </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef">(</Chunk><Chunk type="FunctionRef">UUID</Chunk><Chunk type="NoRef">); h);

n =

( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 1; 1) ;1;1)-1) * ( 16 ^ 31 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 2; 1) ;1;1)-1) * ( 16 ^ 30 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 3; 1) ;1;1)-1) * ( 16 ^ 29 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 4; 1) ;1;1)-1) * ( 16 ^ 28 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 5; 1) ;1;1)-1) * ( 16 ^ 27 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 6; 1) ;1;1)-1) * ( 16 ^ 26 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 7; 1) ;1;1)-1) * ( 16 ^ 25 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 8; 1) ;1;1)-1) * ( 16 ^ 24 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 9; 1) ;1;1)-1) * ( 16 ^ 23 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 10; 1) ;1;1)-1) * ( 16 ^ 22 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 11; 1) ;1;1)-1) * ( 16 ^ 21 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 12; 1) ;1;1)-1) * ( 16 ^ 20 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 13; 1) ;1;1)-1) * ( 16 ^ 19 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 14; 1) ;1;1)-1) * ( 16 ^ 18 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 15; 1) ;1;1)-1) * ( 16 ^ 17 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 16; 1) ;1;1)-1) * ( 16 ^ 16 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 17; 1) ;1;1)-1) * ( 16 ^ 15 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 18; 1) ;1;1)-1) * ( 16 ^ 14 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 19; 1) ;1;1)-1) * ( 16 ^ 13 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 20; 1) ;1;1)-1) * ( 16 ^ 12 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 21; 1) ;1;1)-1) * ( 16 ^ 11 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 22; 1) ;1;1)-1) * ( 16 ^ 10 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 23; 1) ;1;1)-1) * ( 16 ^ 9 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 24; 1) ;1;1)-1) * ( 16 ^ 8 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 25; 1) ;1;1)-1) * ( 16 ^ 7 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 26; 1) ;1;1)-1) * ( 16 ^ 6 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 27; 1) ;1;1)-1) * ( 16 ^ 5 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 28; 1) ;1;1)-1) * ( 16 ^ 4 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 29; 1) ;1;1)-1) * ( 16 ^ 3 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 30; 1) ;1;1)-1) * ( 16 ^ 2 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 31; 1) ;1;1)-1) * ( 16 ^ 1 ) +
( </Chunk><Chunk type="FunctionRef">Position</Chunk><Chunk type="NoRef">( h; </Chunk><Chunk type="FunctionRef">Middle</Chunk><Chunk type="NoRef">( t; 32; 1) ;1;1)-1)

];

n

)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="29" functionArity="1" visible="True" parameters="dimension" name="WindowCenter"><Calculation><![CDATA[/**
 * =====================================================
 * WindowCenter ( dimension )
 *
 * PARAMETERS:
 *		@dimension (enumeration) Vertical, Horizontal
 *
 * RETURNS:
 *		(int) Screen position value based on dimension
 *		supplied

 * DEPENDENCIES:
 *		none

 * NOTES:
 *		Using a locally scoped variable within your
 *		script will alter what this function returns
 *		$parentWindowHeight for window height of parent
 *		$parentWindowWidth for window width of parent
 *		$parentWindowTop for window top of parent
 *		$parentWindowLeft for window left of parent
 *		$childWindowWidth MUST BE SET! when centering on parent
 *		$childWindowHeight MUST BE SET! when centering on parent
 * =====================================================
 *
 */

Let ( [
	~vertical = PatternCount ( dimension ; "vert" ) or dimension = "y" or dimension = "top";
	~horizontal = PatternCount ( dimension ; "horiz" ) or dimension = "x" or dimension = "left";
	~parentIsSet = not IsEmpty ( $parentWindowTop )
					and not IsEmpty ( $parentWindowLeft )
					and not IsEmpty ( $parentWindowWidth )
					and not IsEmpty ( $parentWindowHeight );
	~parentOnScreen = ~parentIsSet
					and ( $parentWindowTop + $parentWindowHeight ≤ Get ( WindowDesktopHeight )
					and $parentWindowLeft + $parentWindowWidth ≤ Get ( WindowDesktopWidth ) );
	~parentHeight = If ( not ~parentIsSet or not ~parentOnScreen;
			Get ( WindowDesktopHeight );
		/*else*/
			$parentWindowHeight
		);
	~parentWidth = If ( not ~parentIsSet or not ~parentOnScreen;
			Get ( WindowDesktopWidth );
		/*else*/
			$parentWindowWidth
		);
	~childHeight = If ( IsEmpty ( $childWindowHeight );
			Get ( WindowHeight );
		/*else*/
			$childWindowHeight
		);
	~childWidth = If ( IsEmpty ( $childWindowWidth );
			Get ( WindowWidth );
		/*else*/
			$childWindowWidth
		)
];
	Case (
		~vertical;
			Int ( ( ~parentHeight / 2) - ( ~childHeight / 2 )
			+ If ( ~parentOnScreen ; $parentWindowTop ) );
		~horizontal;
			Int ( ( ~parentWidth / 2) - ( ~childWidth / 2 )
			+ If ( ~parentOnScreen ; $parentWindowLeft ) )
	)
)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/**
 * =====================================================
 * WindowCenter ( dimension )
 *
 * PARAMETERS:
 *		@dimension (enumeration) Vertical, Horizontal
 *
 * RETURNS:
 *		(int) Screen position value based on dimension
 *		supplied

 * DEPENDENCIES:
 *		none

 * NOTES:
 *		Using a locally scoped variable within your
 *		script will alter what this function returns
 *		$parentWindowHeight for window height of parent
 *		$parentWindowWidth for window width of parent
 *		$parentWindowTop for window top of parent
 *		$parentWindowLeft for window left of parent
 *		$childWindowWidth MUST BE SET! when centering on parent
 *		$childWindowHeight MUST BE SET! when centering on parent
 * =====================================================
 *
 */

</Chunk><Chunk type="FunctionRef">Let</Chunk><Chunk type="NoRef"> ( [
	~vertical = </Chunk><Chunk type="FunctionRef">PatternCount</Chunk><Chunk type="NoRef"> ( dimension ; "vert" ) </Chunk><Chunk type="FunctionRef">or</Chunk><Chunk type="NoRef"> dimension = "y" </Chunk><Chunk type="FunctionRef">or</Chunk><Chunk type="NoRef"> dimension = "top";
	~horizontal = </Chunk><Chunk type="FunctionRef">PatternCount</Chunk><Chunk type="NoRef"> ( dimension ; "horiz" ) </Chunk><Chunk type="FunctionRef">or</Chunk><Chunk type="NoRef"> dimension = "x" </Chunk><Chunk type="FunctionRef">or</Chunk><Chunk type="NoRef"> dimension = "left";
	~parentIsSet = </Chunk><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">IsEmpty</Chunk><Chunk type="NoRef"> ( $parentWindowTop )
					</Chunk><Chunk type="FunctionRef">and</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">IsEmpty</Chunk><Chunk type="NoRef"> ( $parentWindowLeft )
					</Chunk><Chunk type="FunctionRef">and</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">IsEmpty</Chunk><Chunk type="NoRef"> ( $parentWindowWidth )
					</Chunk><Chunk type="FunctionRef">and</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">IsEmpty</Chunk><Chunk type="NoRef"> ( $parentWindowHeight );
	~parentOnScreen = ~parentIsSet
					</Chunk><Chunk type="FunctionRef">and</Chunk><Chunk type="NoRef"> ( $parentWindowTop + $parentWindowHeight ≤ </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowDesktopHeight</Chunk><Chunk type="NoRef"> )
					</Chunk><Chunk type="FunctionRef">and</Chunk><Chunk type="NoRef"> $parentWindowLeft + $parentWindowWidth ≤ </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowDesktopWidth</Chunk><Chunk type="NoRef"> ) );
	~parentHeight = </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"> ~parentIsSet </Chunk><Chunk type="FunctionRef">or</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"> ~parentOnScreen;
			</Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowDesktopHeight</Chunk><Chunk type="NoRef"> );
		/*else*/
			$parentWindowHeight
		);
	~parentWidth = </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"> ~parentIsSet </Chunk><Chunk type="FunctionRef">or</Chunk><Chunk type="NoRef"/><Chunk type="FunctionRef">not</Chunk><Chunk type="NoRef"> ~parentOnScreen;
			</Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowDesktopWidth</Chunk><Chunk type="NoRef"> );
		/*else*/
			$parentWindowWidth
		);
	~childHeight = </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">IsEmpty</Chunk><Chunk type="NoRef"> ( $childWindowHeight );
			</Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowHeight</Chunk><Chunk type="NoRef"> );
		/*else*/
			$childWindowHeight
		);
	~childWidth = </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">IsEmpty</Chunk><Chunk type="NoRef"> ( $childWindowWidth );
			</Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowWidth</Chunk><Chunk type="NoRef"> );
		/*else*/
			$childWindowWidth
		)
];
	</Chunk><Chunk type="FunctionRef">Case</Chunk><Chunk type="NoRef"> (
		~vertical;
			</Chunk><Chunk type="FunctionRef">Int</Chunk><Chunk type="NoRef"> ( ( ~parentHeight / 2) - ( ~childHeight / 2 )
			+ </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( ~parentOnScreen ; $parentWindowTop ) );
		~horizontal;
			</Chunk><Chunk type="FunctionRef">Int</Chunk><Chunk type="NoRef"> ( ( ~parentWidth / 2) - ( ~childWidth / 2 )
			+ </Chunk><Chunk type="FunctionRef">If</Chunk><Chunk type="NoRef"> ( ~parentOnScreen ; $parentWindowLeft ) )
	)
)</Chunk></DisplayCalculation></CustomFunction><CustomFunction id="30" functionArity="0" visible="True" parameters="" name="WindowProperties"><Calculation><![CDATA[/*
 * =====================================================
 * WindowProperties ( )
 *
 * RETURNS:
 * 		Let () formatted list of global variables with prefix of 'window'
 *
 * PARAMETERS:
 *		none
 *
 * EXAMPLES:
 * 		Substitute ( WindowProperties ; "$$" ; "$" ) //= locally scoped $window[Value] variables
 * 		Substitute ( WindowProperties ; "$$" ; "$parent" ) //= locally scoped $parentwindow[Value] variables
 *
 * RETURNS:
 *		formatted global let variables
 *
 * DEPENDENCIES:
 *		none
 *
 * NOTES:
 *		See WindowCenter companion function. It will center a window within a parent
 *		window when $parentWindow[Value] variables are set.
 * =====================================================
 *
 */

Substitute (
	List (
		"$$windowName = " & Quote ( Get ( WindowName ) );
		"$$windowLayout = " & Quote ( Get ( LayoutName ) );
		"$$windowLayoutID = " & GetValue ( LayoutIDs ( Get ( FileName ) ) ; Get ( LayoutNumber ) );
		"$$windowTop = " & Get ( WindowTop );
		"$$windowLeft = " & Get ( WindowLeft );
		"$$windowWidth = " & Get ( WindowWidth );
		"$$windowHeight = " & Get ( WindowHeight );
		"$$windowViewAs = " & Get ( LayoutViewState );
		"$$windowMode = " & Get ( WindowMode );
		"$$windowStatusArea = " & Get ( StatusAreaState );
		"$$windowZoomLevel = " & Get ( WindowZoomLevel );
		"$$windowTextRuler = " & Get ( TextRulerVisible );
	);
	[ ¶ ; ";¶" ] // adding semi colons to each line
)]]></Calculation><DisplayCalculation><Chunk type="NoRef">/*
 * =====================================================
 * WindowProperties ( )
 *
 * RETURNS:
 * 		Let () formatted list of global variables with prefix of 'window'
 *
 * PARAMETERS:
 *		none
 *
 * EXAMPLES:
 * 		Substitute ( WindowProperties ; "$$" ; "$" ) //= locally scoped $window[Value] variables
 * 		Substitute ( WindowProperties ; "$$" ; "$parent" ) //= locally scoped $parentwindow[Value] variables
 *
 * RETURNS:
 *		formatted global let variables
 *
 * DEPENDENCIES:
 *		none
 *
 * NOTES:
 *		See WindowCenter companion function. It will center a window within a parent
 *		window when $parentWindow[Value] variables are set.
 * =====================================================
 *
 */

</Chunk><Chunk type="FunctionRef">Substitute</Chunk><Chunk type="NoRef"> (
	</Chunk><Chunk type="FunctionRef">List</Chunk><Chunk type="NoRef"> (
		"$$windowName = " & </Chunk><Chunk type="FunctionRef">Quote</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowName</Chunk><Chunk type="NoRef"> ) );
		"$$windowLayout = " & </Chunk><Chunk type="FunctionRef">Quote</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">LayoutName</Chunk><Chunk type="NoRef"> ) );
		"$$windowLayoutID = " & </Chunk><Chunk type="FunctionRef">GetValue</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">LayoutIDs</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">FileName</Chunk><Chunk type="NoRef"> ) ) ; </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">LayoutNumber</Chunk><Chunk type="NoRef"> ) );
		"$$windowTop = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowTop</Chunk><Chunk type="NoRef"> );
		"$$windowLeft = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowLeft</Chunk><Chunk type="NoRef"> );
		"$$windowWidth = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowWidth</Chunk><Chunk type="NoRef"> );
		"$$windowHeight = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowHeight</Chunk><Chunk type="NoRef"> );
		"$$windowViewAs = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">LayoutViewState</Chunk><Chunk type="NoRef"> );
		"$$windowMode = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowMode</Chunk><Chunk type="NoRef"> );
		"$$windowStatusArea = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">StatusAreaState</Chunk><Chunk type="NoRef"> );
		"$$windowZoomLevel = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">WindowZoomLevel</Chunk><Chunk type="NoRef"> );
		"$$windowTextRuler = " & </Chunk><Chunk type="FunctionRef">Get</Chunk><Chunk type="NoRef"> ( </Chunk><Chunk type="FunctionRef">TextRulerVisible</Chunk><Chunk type="NoRef"> );
	);
	[ ¶ ; ";¶" ] </Chunk><Chunk type="FunctionRef">// adding semi colons to each line
</Chunk><Chunk type="NoRef">)</Chunk></DisplayCalculation></CustomFunction></CustomFunctionCatalog><ExternalDataSourcesCatalog/><CustomMenuSetCatalog/><CustomMenuCatalog/><Options><Encryption type="0"/><OnOpen><MinimumAllowedVersion name="12.0" id="1208"/><Account name="Admin"/></OnOpen><DefaultCustomMenuSet><CustomMenuSet id="1" name="[Standard FileMaker Menus]"/></DefaultCustomMenuSet></Options><ThemeCatalog><Theme group="" name="Cool Gray" locale="en" version="2" internalName="com.filemaker.theme.cool_gray" id="01"><CustomStyles/><DefaultStyles>
rounded:normal .self
{
	background-color: rgba(98.0392%,98.0392%,98.0392%,1);
	border-top-color: rgba(60%,60%,60%,1);
	border-right-color: rgba(60%,60%,60%,1);
	border-bottom-color: rgba(60%,60%,60%,1);
	border-left-color: rgba(60%,60%,60%,1);
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-width: 1pt;
	border-right-width: 1pt;
	border-bottom-width: 1pt;
	border-left-width: 1pt;
	border-top-right-radius: 5pt 5pt;
	border-bottom-right-radius: 5pt 5pt;
	border-bottom-left-radius: 5pt 5pt;
	border-top-left-radius: 5pt 5pt;
}
rounded:normal .inner_border
{
	border-top-right-radius: 4pt 4pt;
	border-bottom-right-radius: 4pt 4pt;
	border-bottom-left-radius: 4pt 4pt;
	border-top-left-radius: 4pt 4pt;
}

line:normal .self
{
	border-top-color: rgba(31.3726%,31.3726%,31.3726%,1);
	border-right-color: rgba(31.3726%,31.3726%,31.3726%,1);
	border-bottom-color: rgba(31.3726%,31.3726%,31.3726%,1);
	border-left-color: rgba(31.3726%,31.3726%,31.3726%,1);
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-width: 1pt;
	border-right-width: 1pt;
	border-bottom-width: 1pt;
	border-left-width: 1pt;
}

leading_sub_summary_1:normal .self
{
	background-color: rgba(40%,40%,40%,1);
	border-top-color: rgba(94.902%,94.902%,94.902%,1);
	border-top-style: solid;
	border-top-width: 1pt;
}

trailing_sub_summary_2:normal .self
{
	background-color: rgba(94.902%,94.902%,94.902%,1);
	border-top-color: rgba(60%,60%,60%,1);
	border-top-style: solid;
	border-top-width: 2pt;
}

leading_sub_summary:normal .self
{
	background-color: rgba(80%,80%,80%,1);
	border-top-color: rgba(94.902%,94.902%,94.902%,1);
	border-top-style: solid;
	border-top-width: 1pt;
}

trailing_sub_summary_1:normal .self
{
	background-color: rgba(94.902%,94.902%,94.902%,1);
	border-top-color: rgba(40%,40%,40%,1);
	border-top-style: solid;
	border-top-width: 2pt;
}

footer:normal .self
{
	background-image: -webkit-gradient(linear,25% 0%,25% 100%, from(rgba(47.451%,47.451%,47.451%,1)), to(rgba(43.5294%,43.5294%,43.5294%,1)));
	border-top-color: rgba(38.0392%,38.0392%,38.0392%,1);
	border-bottom-color: rgba(33.7255%,33.7255%,33.7255%,1);
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-width: 1pt;
	border-bottom-width: 1pt;
}
footer:normal .inner_border
{
	border-top-color: rgba(69.0196%,69.0196%,69.0196%,1);
	border-bottom-color: rgba(66.2745%,66.2745%,66.2745%,1);
	border-top-style: solid;
	border-bottom-style: solid;
	border-top-width: 1pt;
	border-bottom-width: 1pt;
}

scrollbar:normal .self
{
	background-color: rgba(90.1961%,90.1961%,90.1961%,1);
	border-left-color: rgba(80%,80%,80%,1);
	border-left-style: solid;
	border-left-width: 1pt;
	border-top-right-radius: 5pt 5pt;
	border-bottom-right-radius: 5pt 5pt;
	width: 17pt;
}
scrollbar:disabled .self
{
	background-color: rgba(100%,100%,100%,1);
	border-left-color: rgba(80%,80%,80%,1);
	border-left-style: solid;
	border-left-width: 1pt;
	border-top-right-radius: 5pt 5pt;
	border-bottom-right-radius: 5pt 5pt;
}
scrollbar:normal .scrollbar_top_button
{
	background-color: rgba(100%,100%,100%,1);
	border-bottom-color: rgba(80%,80%,80%,1);
	border-left-color: rgba(80%,80%,80%,1);
	border-bottom-style: solid;
	border-left-style: solid;
	border-bottom-width: 1pt;
	border-left-width: 1pt;
	border-top-right-radius: 5pt 5pt;
	width: 100%;
	height: 17pt;
	-fm-icon: up-arrow;
	-fm-icon-color: rgba(30.9804%,30.9804%,30.9804%,1);
}
scrollbar:hover .scrollbar_top_button
{
	background-color: rgba(90.1961%,90.1961%,90.1961%,1);
	border-bottom-color: rgba(80%,80%,80%,1);
	border-left-color: rgba(80%,80%,80%,1);
	border-bottom-style: solid;
	border-left-style: solid;
	border-bottom-width: 1pt;
	border-left-width: 1pt;
	border-top-right-radius: 5pt 5pt;
	width: 100%;
	height: 17pt;
	-fm-icon: up-arrow;
	-fm-icon-color: rgba(30.9804%,30.9804%,30.9804%,1);
}
scrollbar:pressed .scrollbar_top_button
{
	background-color: rgba(80%,80%,80%,1);
	border-bottom-color: rgba(60%,60%,60%,1);
	border-left-color: rgba(60%,60%,60%,1);
	border-bottom-style: solid;
	border-left-style: solid;
	border-bottom-width: 1pt;
	border-left-width: 1pt;
	border-top-right-radius: 5pt 5pt;
	width: 100%;
	height: 17pt;
	-fm-icon: up-arrow;
	-fm-icon-color: rgba(30.9804%,30.9804%,30.9804%,1);
}
scrollbar:normal .scrollbar_bottom_button
{
	background-color: rgba(100%,100%,100%,1);
	border-top-color: rgba(80%,80%,80%,1);
	border-left-color: rgba(80%,80%,80%,1);
	border-top-style: solid;
	border-left-style: solid;
	border-top-width: 1pt;
	border-left-width: 1pt;
	border-bottom-right-radius: 5pt 5pt;
	width: 100%;
	height: 17pt;
	-fm-icon: down-arrow;
	-fm-icon-color: rgba(30.9804%,30.9804%,30.9804%,1);
}
scrollbar:hover .scrollbar_bottom_button
{
	background-color: rgba(90.1961%,90.1961%,90.1961%,1);
	border-top-color: rgba(80%,80%,80%,1);
	border-left-color: rgba(80%,80%,80%,1);
	border-top-style: solid;
	border-left-style: solid;
	border-top-width: 1pt;
	border-left-width: 1pt;
	border-bottom-right-radius: 5pt 5pt;
	width: 100%;
	height: 17pt;
	-fm-icon: down-arrow;
	-fm-icon-color: rgba(30.9804%,30.9804%,30.9804%,1);
}
scrollbar:pressed .scrollbar_bottom_button
{
	background-color: rgba(80%,80%,80%,1);
	border-top-color: rgba(60%,60%,60%,1);
	border-left-color: rgba(60%,60%,60%,1);
	border-top-style: solid;
	border-left-style: solid;
	border-top-width: 1pt;
	border-left-width: 1pt;
	border-bottom-right-radius: 5pt 5pt;
	width: 100%;
	height: 17pt;
	-fm-icon: down-arrow;
	-fm-icon-color: rgba(30.9804%,30.9804%,30.9804%,1);
}
scrollbar:normal .scrollbar_thumb
{
	background-color: rgba(100%,100%,100%,1);
	border-top-color: rgba(80%,80%,80%,1);
	border-bottom-color: rgba(80%,80%,80%,1);
	border-left-color: rgba(80%,80%,80%,1);
	border-top-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-width: 1pt;
	border-bottom-width: 1pt;
	border-left-width: 1pt;
	width: 100%;
}

leading_sub_summary_2:normal .self
{
	background-color: rgba(60%,60%,60%,1);
}

trailing_grand_summary:normal .self
{
	background-color: rgba(20%,20%,20%,1);
}

body_alt:normal .self
{
	background-color: rgba(98.0392%,98.0392%,98.0392%,1);
}

tab_panel:normal .self
{
	background-color: rgba(86.2745%,86.2745%,86.2745%,1);
	border-top-color: rgba(73.7255%,73.7255%,73.7255%,1);
	border-right-color: rgba(73.7255%,73.7255%,73.7255%,1);
	border-bottom-color: rgba(73.7255%,73.7255%,73.7255%,1);
	border-left-color: rgba(73.7255%,73.7255%,73.7255%,1);
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-width: 1pt;
	border-right-width: 1pt;
	border-bottom-width: 1pt;
	border-left-width: 1pt;
	border-top-right-radius: 5pt 5pt;
	border-bottom-right-radius: 5pt 5pt;
	border-bottom-left-radius: 5pt 5pt;
	border-top-left-radius: 5pt 5pt;
	-fm-tab-top-left-radius: 5pt 5pt;
	-fm-tab-top-right-radius: 5pt 5pt;
}
tab_panel:hover .self
{
	background-image: -webkit-gradient(linear,25% 0%,25% 100%, from(rgba(86.2745%,86.2745%,86.2745%,1)), to(rgba(72.9412%,72.9412%,72.9412%,1)));
}
tab_panel:focus .self
{
	background-image: -webkit-gradient(linear,25% 0%,25% 100%, from(rgba(93.7255%,93.7255%,93.7255%,1)), to(rgba(86.2745%,86.2745%,86.2745%,1)));
	box-shadow: 0pt 0pt 2pt 1pt rgba(21.5686%,43.5294%,87.8431%,1);
}
tab_panel:checked .self
{
	background-image: none;
	background-color: rgba(98.0392%,98.0392%,98.0392%,1);
	border-top-color: rgba(73.7255%,73.7255%,73.7255%,1);
	border-right-color: rgba(73.7255%,73.7255%,73.7255%,1);
	border-bottom-color: rgba(73.7255%,73.7255%,73.7255%,1);
	border-left-color: rgba(73.7255%,73.7255%,73.7255%,1);
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-width: 1pt;
	border-right-width: 1pt;
	border-bottom-width: 1pt;
	border-left-width: 1pt;
	box-shadow: 0pt 1pt 4pt 1pt rgba(0%,0%,0%,0.1);
}
tab_panel:checkedfocus .self
{
	background-image: none;
	box-shadow: 0pt 0pt 2pt 1pt rgba(21.5686%,43.5294%,87.8431%,1);
}
tab_panel:normal .inner_border
{
	border-top-right-radius: 4pt 4pt;
	border-bottom-right-radius: 4pt 4pt;
	border-bottom-left-radius: 4pt 4pt;
	border-top-left-radius: 4pt 4pt;
}
tab_panel:normal .text
{
	height: 100%;
	box-sizing: border-box;
}
tab_panel:hover .text
{
	height: 100%;
	box-sizing: border-box;
}
tab_panel:focus .text
{
	height: 100%;
	box-sizing: border-box;
}
tab_panel:checked .text
{
	height: 100%;
	box-sizing: border-box;
}
tab_panel:checkedfocus .text
{
	height: 100%;
	box-sizing: border-box;
}
tab_panel:normal .tab
{
	background-image: -webkit-gradient(linear,25% 0%,25

license: MIT

license_type: permissive

branch_name: refs/heads/master