User Tools

Site Tools


manual:Calculations

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
manual:Calculations [2018/06/30 03:26]
peternlewis [Operators]
manual:Calculations [2019/06/17 23:46]
peternlewis [Operators]
Line 3: Line 3:
 ===== Overview ===== ===== Overview =====
  
-Keyboard Maestro supports calculations in almost any numeric [[/​Text_Fields|text fields]]. ​ For example you can Pause for "​60*Time in Minutes"​. ​ Calculations can also use comma separated lists of numbers as arrays, and can return such arrays, so you can operate on frames and points. ​ Numeric fields often start small with up/down step arrows, but if you type anything other than a number they will expand to allow a more complex expression to be entered. ​ You can tell that a field accepts calculations because a small BUTTON{{{C}}} shows in the field while editing it.+Keyboard Maestro supports calculations in almost any numeric [[/​Text_Fields|text fields]]. ​ For example you can Pause for "​60*Time in Minutes"​. ​ Calculations can also use comma separated lists of numbers as arrays, and can return such arrays, so you can operate on rectangle ​frames and points. ​ Numeric fields often start small with up/down step arrows, but if you type anything other than a number they will expand to allow a more complex expression to be entered. ​ You can tell that a field accepts calculations because a small BUTTON{{{C}}} shows in the field while editing it.
  
 ===== Examples ===== ===== Examples =====
Line 25: Line 25:
 | Array Separator (`,`) | Allows a text Variable, which has comma separated values, to work somewhat like an Array.\\ Assume `MyKMVariable` contains "​value1,​value2,​value3"​.\\ Then `MyKMVariable[2]` returns "​value2"​. | | Array Separator (`,`) | Allows a text Variable, which has comma separated values, to work somewhat like an Array.\\ Assume `MyKMVariable` contains "​value1,​value2,​value3"​.\\ Then `MyKMVariable[2]` returns "​value2"​. |
 | Ternary Operator (`?`) | a=b ? 3 : 4 | | Ternary Operator (`?`) | a=b ? 3 : 4 |
-| Bitwise OR (`|`), Bitwise AND (`&`) and Bitwise XOR | operators |+| Bitwise OR (`|`), Bitwise AND (`&`) and Bitwise XOR | bitwise ​operators |
 | Comparison Operators (`<, ≤, =, >, ≥, ≠`) | compare for (in)equality and return 0 or 1 | | Comparison Operators (`<, ≤, =, >, ≥, ≠`) | compare for (in)equality and return 0 or 1 |
 | Shift Operators (`≪, ≫`) | shift a number left or right | | Shift Operators (`≪, ≫`) | shift a number left or right |
manual/Calculations.txt · Last modified: 2023/10/02 00:38 by peternlewis