-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathvar.set.fmfn
31 lines (30 loc) · 1.13 KB
/
var.set.fmfn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* =====================================================
* var.set( name ; value )
*
* RETURNS: (bool) True or False based on proper evaluation
* DEPENDENCIES: none
* NOTES: see var.eval for declaring multiple variables
* =====================================================
*
* This custom function is a wrapper for the
* assignment(creation) of global variables.
* Variables are not tracked and errors are
* revealed within $$ERROR.VAR.SET
*/
Let ( $function.var.make.value = value; // preserve the data type of the inbound value
Let ( [
$$ERROR.VAR.SET = ""; // Reset the global error variable for evaluation
var.dollarsign = If ( Left ( name ; 2 ) = "$$" or Left ( name ; 1 ) = "$"; "" ; "$$" ); // check for prefixed $$ or $
var.calc = "Let ( " & var.dollarsign & name & " = $function.var.make.value; False )"
];
If (
Evaluate(
var.calc
) = "?";
Let ( $$ERROR.VAR.SET = List ("EVAL ERROR"; "-------"; var.calc ); False );
// Insert the name of the variable into the reserved $$VARIABLES global variable
True
)
)
)