After reading the manual and trying it by myself I couldn't figure out how can I use the calculator functions. Can someone post an example of calling a math function?
The other question is related to the macros. Is there a way of keeping a state between calling two or more macros (something like a flag for instance)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Generally, the math functions are accessible via Esc-M (or Alt-M or Meta-M depending on your keyboard and terminal). Then you can type something like cos(pi), and it will show -1 as a message. In handwritten macros, you would just use if. The scenarios that I've come across where it's useful is to, for example, sum all the numbers in a block, which would just be Esc-M sum. Joe could give a more detailed answer, but hopefully that gets you a little further with what's in the manual.
As for keeping state between macros? Nothing that I'm aware of, apart from maybe using a scratch buffer. But I'm not sure how it might be hidden without losing its contents.
HTH
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using JOE 4.4 for Windows and when I call the functions (like cos(pi)) I get "Called object is not a function". Are the math function avaiable in the Windows version (I already cаme across the regular expressions problem and saw the opened ticked)?
Last edit: P. S. 2017-07-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was afraid you might say that :-). It looks like those functions are all hiding behind compiler flags that were never set. Thanks for the report, I'll fix it.
Lastly, if you just need a flag (yes/no) then it occurred to me that you might be able to use "ans", which stores the last math result. Whether it will suit your need depends on what you plan to do, however. It might not work if, for instance, other macros that use 'if' or 'math' are invoked in the meantime between your macro's invocation.
After reading the manual and trying it by myself I couldn't figure out how can I use the calculator functions. Can someone post an example of calling a math function?
The other question is related to the macros. Is there a way of keeping a state between calling two or more macros (something like a flag for instance)?
Generally, the math functions are accessible via Esc-M (or Alt-M or Meta-M depending on your keyboard and terminal). Then you can type something like cos(pi), and it will show -1 as a message. In handwritten macros, you would just use
if. The scenarios that I've come across where it's useful is to, for example, sum all the numbers in a block, which would just be Esc-M sum. Joe could give a more detailed answer, but hopefully that gets you a little further with what's in the manual.As for keeping state between macros? Nothing that I'm aware of, apart from maybe using a scratch buffer. But I'm not sure how it might be hidden without losing its contents.
HTH
I'm using JOE 4.4 for Windows and when I call the functions (like cos(pi)) I get "Called object is not a function". Are the math function avaiable in the Windows version (I already cаme across the regular expressions problem and saw the opened ticked)?
Last edit: P. S. 2017-07-26
I was afraid you might say that :-). It looks like those functions are all hiding behind compiler flags that were never set. Thanks for the report, I'll fix it.
(Are you referring to [#373]?)
Lastly, if you just need a flag (yes/no) then it occurred to me that you might be able to use "ans", which stores the last math result. Whether it will suit your need depends on what you plan to do, however. It might not work if, for instance, other macros that use 'if' or 'math' are invoked in the meantime between your macro's invocation.
Related
Bugs:
#373Yes, I was referring to it. Thanks for commiting to them.