On this page:
Reset and Exit, Help, Mode Setting, Output Format, Results and Clipboard, Variables, User Defined Elements, Files, Loops and Repeat, Conditional Execution, Ending Loops, Buffer.
A few commands are listed under two headings.
RESET -- delete results, delete all variables and all user defined elements, reset all options to default or to command line parameters, run configuration file hy.ini.
Q or QUIT -- end program, close console window if it had been opened by Hypatia.
You can also just close the console window, Hypatia keeps no files open that could be lost or corrupted.
empty input line -- display program version and basic help info.
? -- display program version and settings.
HELP -- display help overview.
HELP ? -- display available help topics.
HELP doc -- open this documentation.
AUTO$ ON or OFF -- set auto include $ mode ON (default) or OFF.
ECHO ON or OFF -- set echo mode ON or OFF (default).
LOG ON or OFF -- start or stop (default) logging input and output to file hy.log.
INTEGER ON or OFF -- set integer bias ON (default) or OFF.
USE DEG or RAD -- angle unit is degrees or radians (default), do not confuse with DEG and RAD operators.
COPYALL ON or OFF -- set copy to clipboard mode ON (all results will be copied to the clipboard) or OFF (default).
AUTO$, ECHO, LOG, INTEGER, USE, COPYALL -- show current mode.
For single line modes accumulation mode, silent mode and debug mode see next page Control Symbols and Comments.
For buffer mode see "Buffer Commands" below.
FSHORT -- show only up to 9 digits (does not affect FDEC n).
FLONG -- show up to 15 digits (default).
FDEC -- default, decimal format, scientific notation for large or small numbers.
FDEC n -- show results with n digits after decimal point.
FDEC -n -- show results with at least n digits before decimal point (with leading zeros if necessary).
FSCI -- show results in scientific notation, 15 digits (9 digits with FSHORT) and exponent.
FHEX -- use hexadecimal format for displaying results (only valid for positive integer numbers).
FHEX n -- use hexadecimal format, with at least n digits (2 to 12 digits).
FBIN -- use binary format for displaying results (only valid for positive integer numbers).
FBIN n -- use binary format, with at least n digits (2 to 48 digits).
FLAKH -- decimal format, numbers greater or equal one hundred thousand are shown in lakh, numbers greater or equal ten million in crore.
FMILLION -- decimal format, numbers greater or equal one million are shown in million.
F' ON or OFF -- apostrophe format ON (default) or OFF.
F' -- toggles apostrophe format ON/OFF.
= -- show last result (value of $) in currently chosen format.
== -- show last result (value of $) in decimal format with up to 18 digits (with floating point numbers reliability decreases after the 15th digit).
HY -- show content of result file hy (unless it has more than 40 lines or 4000 characters).
EDIT -- open result file hy in editor (same as EDIT hy).
$ -- write last result (value of $) to hy in the currently specified format. Not allowed in scripts or in buffer mode (you can use $ & though).
& -- clear result file hy (if buffer mode is ON, clear buffer).
&& -- add a line break to result file hy (if buffer mode is ON, to buffer).
COPY -- copy the result file hy to the clipboard (previous content of clipboard will be overwritten). Not allowed in buffer mode (you can still use EDIT).
COPYALL ON or OFF -- set copy to clipboard mode ON (all results will be copied to the clipboard, ignored in scripts and in buffer mode) or OFF (default).
COPYALL -- show current copyall mode.
COPIN -- copy last calculation input line to clipboard.
STO $var -- assign value of last result to variable (create variable if it doesn't already exist).
$var = ... -- assign number or calculation result to variable (create variable if it doesn't already exist).
PROMPT $var comment -- prompt user for value of variable (number or calculation), optional comment text after variable name will be displayed.
DEL $var -- delete variable (only one variable can be deleted at the same time).
SHOW -- display all variables; if angle mode is set to degrees, this will be displayed.
SHOW $var1 $var2 ... -- display these variables (the list can include loop index I and loop timer TIME).
SAVE filename comment -- save all variables to file, optional comment text after filename will be written to the file as a comment line.
_filename -- retrieve variables from file (same as RUN filename).
@ude = ... -- assign content to user-defined element (create user defined element if it doesn't exist).
DEL@ @ude -- delete user-defined element (only one UDE can be deleted at the same time).
SHOW@ -- display all user-defined elelements.
SHOW@ @ude1 @ude2 ... -- display these user-defined elements.
SAVE@ filename comment -- save all user-defined elements to file, optional comment text after filename will be written to the file as a comment line.
_filename -- retrieve user-defined elements from file (same as RUN filename).
FILES -- show all files in Hypatia's program folder.
EDIT filename -- open editor to view, edit or create the specified file (must be located in Hypatia's program folder).
EDIT -- open result fily hy to view or edit (short for EDIT hy).
EDIN -- open editor to view or edit file hyin (short for EDIT hyin).
EDINI -- open editor to view or edit file hy.ini (short for EDIT hy.ini).
EDLOG -- open editor to view or edit file hyin (short for EDIT hy.log).
EDNOTES -- open editor to view or edit file notes.txt (short for EDIT notes.txt).
EXTEDITOR filename -- replace default editor notepad.exe with an editor of your choice (path and filename may contain backslashes and spaces).
EXTEDITOR -- show the currently chosen external editor.
RUN filename -- execute a script file, each line is treated as an input line. Not allowed in scripts.
_filename -- same as RUN filename, but without displaying intermediate results. Not allowed in scripts.
... (filename) ... -- insert content of file in input line.
& -- clear result file hy (if buffer mode is ON, clear buffer).
&& -- add a line break to result file hy (if buffer mode is ON, to buffer).
HY -- show content of result file hy.
Spaces and the characters ? * ( ) \ / | > < are not allowed in file names. File names must not begin with $ or @.
None of these commands are allowed in scripts.
MAXLOOP n -- set maximum number of loop passes (by default one hundred thousand, max. ten million).
DO n :: ... -- loop command, execute command or calculation following :: n times.
DO * :: ... -- loop command, n is set to maximum (by default one hundred thousand).
DO n ? :: ... -- same as above but show the current result after each loop pass.
*_filename -- or _*filename, short for DO * :: _filename, run script in loop with maximum number of passes.
REPEAT -- repeat the most recent calculation or script execution.
REPEAT n -- loop command, repeat the most recent calculation or script execution n times.
REPEAT n ? -- same as above but show the current result after each loop pass.
REPEAT * -- loop command, n = maximum (by default one hundred thousand minus 1).
A script called in a loop has several ways to end the loop, see below.
Execution of a calculation, command or comment (comment will be displayed) can be made dependent on a condition being met.
I1: ... -- execute only when loop index is 1, or when not in a loop.
I*: ... -- execute only at the end of loop (except after ABORT command).
IF ... THEN ... -- execute only when condition is met.
(IF is followed by a variable or a mathematical expression. Zero is false, anything not exactly zero is true, zero threshold is not applied.)
ALSO: ... -- execute when preceding IF ... THEN condition was met (there may be other lines in between).
ELSE: ... -- execute when preceding IF ... THEN condition was not met (there may be other lines in between).
ELSE: inverts the true/false condition. Any consecutive ALSO: line refers to the inverted result.
Any number of ALSO: and ELSE: lines can depend on an IF ... THEN condition.
In ALSO: and ELSE: lines IF ... THEN is allowed.
In I1: and I*: lines IF ... THEN is allowed, ALSO: and ELSE: are not allowed.
... SKIP -- used with a condition, skips the rest of the script when the condition is met, but does not end a loop.
... NOTHING -- used with a condition, does nothing (see page "IF ... THEN Conditions" in chapter "Scripts").
... ENDLOOP comment -- used with a condition, if the condition is met the loop is ended after the last line in the script.
... ABORT comment -- used with a condition, if the condition is met the rest of the script is skipped and the loop is ended.
ENDLOOP and ABORT are preceded by IF ... THEN, ALSO: or ELSE:, anything after ENDLOOP or ABORT is displayed as a comment when that command is executed.
$loop = ... -- when variable $loop is set to exactly 0, the loop is ended after the last line in the script.
After an ITEM operator has referenced the last item of its list (or the first item, when the index is negative) the loop ends.
(There is an exception: the loop will not end when a negative index references the first item of the list in the first pass of the loop.)
Loops are aborted when an error occurs.
In buffer mode all output to the result file hy is redirected to the result buffer.
BUFFER START -- turn buffer mode on, with an empty buffer. If buffer mode is already on, clear the buffer.
BUFFER SHOW -- display buffer content (unless the buffer has more than 40 lines or 4000 characters).
BUFFER SAVE filename comment -- save content of the buffer to the specified file, anything after filename gets included as a comment line.
BUFFER FLUSH -- write buffer to hy replacing its previous content, clear the buffer and turn buffer mode off.
BUFFER DISCARD -- clear the buffer without saving it and turn buffer mode off.
BUFFER -- display buffer mode (ON, ON but empty, or OFF).
... (buffer) ... -- if buffer mode is ON insert the content of the buffer into the input line.