Calculation field: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Stamp|2016-09-10|3.9.7|1.0.3}}
{{Stamp|2016-09-10|3.9.7|1.0.3}}
The values in Calculation fields are calculated from the expressions specified by you in Memento Script, defined herein.
The values in Calculation fields are calculated from the expressions specified by you in Memento Script, defined herein.


Line 8: Line 9:


Numeric and string types can not be mixed in a left / right operand pair.  
Numeric and string types can not be mixed in a left / right operand pair.  
== Result type ==
For each calculation, there must be a correct result type set:
; ''Real result'' and ''Integer result''
: are used for expressions with a numerical result.
; ''Date/Time result''
: is used to represent the result in the form of date and time. The calculation result is interpreted as the number of seconds that has passed since January 1, 1970 (UNIX time).
; ''Date result''
: is the same as the previous type, but displays only the date.
; ''String result''
: is used for expressions that contain string manipulations or functions that return a string.


== Variables ==
== Variables ==
Other fields in the same entry and fields in linked libraries may be referenced as read-only variables.
Other fields in the same entry and fields in linked libraries may be referenced as read-only variables.


Line 44: Line 58:
* ! boolean not
* ! boolean not


== Result type ==
== Functions ==
For each calculation, there must be a correct result type set:
Functions are available to assist in crafting expressions to calculate a result. Function calls may be tipped into the expression, or the user may use the '''+Function''' button to display acc tabbed list of functions that may be used.
; ''Real result'' and ''Integer result''
 
: are used for expressions with a numerical result.
=== Math functions ===
 
'''[[TBD]]'''
 
=== Date/Time Functions ===
 
'''[[TBD]]'''
 
=== String functions ===
 
'''[[TBD]]'''


; ''Date/Time result''
=== Logical functions ===
: is used to represent the result in the form of date and time. The calculation result is interpreted as the number of seconds that has passed since January 1, 1970 (UNIX time).
; if(,,): returns one value of a logical expression if TRUE (not equal to 0.0) and another if it is FALSE (equal to 0.0)


; ''Date result''
; switch(,,,): accepts an expression, result/Value pairs, and a default value, and determines the final result based on selecting among the paired results to identify the paired value (or else the default) to be used.<br/> Clear? Probably not, so...
: is the same as the previous type, but displays only the date.


; ''String result''
'''[[TBD]]'''
: is used for expressions that contain string manipulations or functions that return a string.


== Link to Entry ==
== Link to Entry ==
Use the following syntax to get access to the values of Link to Entry and other linking fields:
Use the following syntax to get access to the values of Link to Entry and other linking fields:


Navigation menu