Commands

Home, Up: Appendix

 

On this page:

Reset and Exit, Help, Mode Setting, Output Format, Variables, User Defined Elements, Results and Clipboard, Files, Loops and Repeat, Conditional Execution, Ending Loops, Buffer.

A few commands are listed under two headings.

 

Reset and Exit Commands

RESET -- delete results, all variables and all user defined elements, reset all options to default or to command line parameters.

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.

 

Help Commands

empty input line -- display program version and basic help info.

? -- display program version and settings.

HELP -- display help overview.

HELP ? -- display available help topics.

 

Mode Setting Commands

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 accumulation mode, silent mode and debug mode see next page, "Single Line Modes".

 

Output Format Commands

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 (before decimal point if n is negative).

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.

 

Variables

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 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.

SHOW -- display all variables; if angle mode is set to degrees, this will be displayed.

SHOW $var1 $var2 ... -- display these variables (can include loop index I and loop timer TIME).

SAVE filename comment -- save variables to file, optional comment text after filename will be written to the file as a comment line.

_filename -- retrieve variables from file.

 

User-Defined Elements

@ude = ... -- assign content to user-defined element (create user defined element if it doesn't exist).

DEL@ @ude -- delete user-defined element.

SHOW@ -- display all user-defined elelements.

SHOW@ @ude1 @ude2 ... -- display these user-defined elements.

SAVE@ filename comment -- save 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.

 

Results and Clipboard

= -- show last result (value of $) in currently chosen format.

== -- show last result (value of $) in decimal format with up to 18 digits.

HY -- show content of result file hy (unless more than 40 lines or 4000 characters).

$ -- write last result (value of $) to hy in the currently specified format. Not allowed in scripts.

& -- 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).

COPYALL ON or OFF -- set copy to clipboard mode ON (all results will be copied to the clipboard) or OFF (default).

COPYALL -- show current copyall mode.

COPIN -- copy last calculation input line to clipboard.

 

Files

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.

 

Loops and Repeat

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 executionn 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.

 

Conditional Script Line Execution

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.

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 (does not have to follow immediately).

ELSE: ... -- execute when preceding IF ... THEN condition was not met (does not have to follow immediately).

(ELSE: inverts the true/false condition. Any following ALSO: line refers to the inverted result.)

Any number of ALSO: and ELSE: lines can follow a IF ... THEN statement.

 

... SKIP -- used with a condition, skips the rest of the script when the condition is met, but does not end a loop.

 

Ending Loops

... ENDLOOP -- used with a condition, if the condition is met then the loop is ended after the last line in the script.

$loop = ... -- when variable $loop is set to exactly 0, loop is ended after the last line in the script.

... ABORT -- used with a condition, if the condition is met then the rest of the script is skipped and the loop is ended.

 

When an ITEM operator refers to an invalid index the rest of the script is skipped and the loop is ended.

Usually this is intended behavior, after a list of arguments has been exhausted.

 

Loops are aborted when an error occurs.

 

Buffer Commands

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 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 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.

 

Home, Up: Appendix, Next: Control Symbols and Comments