This is a tip. It's a different way of getting a macro to return a value. An hour ago I posted a method that will probably be frowned upon by the experts, but this method is very different and will probably be approved.
It's a lovely little macro containing three actions:
This gorgeous little macro works like a function that can return a value to a variable by letting you pass the name of the variable as the first parameter to the function, and the remaining parameter acts as the expression to be evaluated.
- The first action splits the parameters into a LocalVar and LocalExpression pair of variables.
- The second action evaluates the expression and saves it into a LocalResult variable.
- The third action saves the result into the LocalVar's evaluated variable name.
So here's one example of how to call it:
I suppose it would be easy enough to add a SWITCH statement that would let you replace the variable's name with certain non-variable concepts, perhaps like this:
In that case you would have to change the yellow action to something like this:
This idea has lots of potential. And it's a nice example of three disparate actions working together to create a seamless result.
I love KM and I love this website, but now I have to figure out how to upload this macro. I always have trouble figuring that out. But if I can't figure it out it's a very short macro to type in yourselves.
P.S. If you look carefully at the green action, you may notice a minor display glitch in the KM editor. I'm sure there's a perfectly good explanation for it, but it does appear a bit glitchy. It's probably a feature, or more likely a design decision, not a bug. But it's cute and intriguing.