On this page:
$ and hy, Result Control Codes, Result Commands, Notes.
To repeat:
After a calculation the pseudo variable $ holds the unformatted result, its former value becomes the new value of $$.
The formatted result is also written to the file hy, except in silent mode or within a script before the script has ended.
Accumulation mode allows more than one result to be written to the file hy.
Assigning a value to a variable does not update $ or hy.
The content of hy can be used in a calculation as an insert file, (hy), or can be read into a user-defined element, @myude = (hy).
As already discussed on the previous page, these codes can be appended to a calculation line, separated by a space.
... # means silent mode, the result will not be written to hy.
... & means accumulation mode, the result will be added to the current content of hy.
... && also means accumulation mode, the result will be added to the current content of hy, but in a new line.
Silent mode and accumulation mode only apply to the particular calculation line.
(About buffer mode see next page, The Result Buffer.)
= -- show the last result (the value of $) in the currently chosen format (nothing gets changed).
== -- show the last result (the value of $) in decimal format with up to 18 digits (nothing gets changed).
$ -- write the last result (the value of $) to hy in the currently specified format. The previous content of hy gets overwritten, $$ is not changed. Not allowed in buffer mode and in scripts. See "Notes" below.
& -- clear the result file hy (hy is not deleted, but will be empty). If buffer mode is on, clear the buffer. $ and $$ are not changed.
0 -- technically this is not a command but a calculation. $ is set to 0, this also becomes the content of hy, $$ assumes the previous value of $.
&& -- add a line break to the result file hy. If buffer mode is on, insert a line break in the buffer.
HY -- show the content of the result file hy (unless it has more than 40 lines or 4000 characters).
EDIT -- open the result file hy in the chosen external editor (by default notepad.exe).
COPY -- copy the content of the result file hy to the Windows clipboard (previous content of the clipboard will be overwritten). Not allowed in buffer mode.
COPYALL ON -- turn copy to clipboard mode on, all results will be copied to the clipboard (each time overwriting the previous content).
COPYALL OFF -- turn copyall mode off.
COPYALL -- show current copyall mode (ON or OFF).
$ on its own (which is a command, not a calculation line) is meant to update hy after the output format was changed. In copy to clipboard mode (COPYALL ON) the result then gets copied to the clipboard in the new format.
The command $ is not allowed in buffer mode and not allowed in scripts. As a command to view the value of $ you can use the commands = or ==.
$ & and $ && are calculation lines, though, and whether in a script or not write the value of $ to hy or the buffer in accumulation mode. The value of $$ is replaced by that of $.
HY and EDIT always refer to the result file hy and do not work with the result buffer (see next page).
Copy to clipboard mode (COPYALL ON) is disabled in buffer mode, in scripts and in loops.
Home, Up: Results, Prev: HY and Accumulation Mode, Next: The Result Buffer