1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
|
.\"/****************************************************************************
.\" Copyright 1995-2022,2024 by Thomas E. Dickey *
.\" All Rights Reserved. *
.\" *
.\" Permission to use, copy, modify, and distribute this software and its *
.\" documentation for any purpose and without fee is hereby granted, provided *
.\" that the above copyright notice appear in all copies and that both that *
.\" copyright notice and this permission notice appear in supporting *
.\" documentation, and that the name of the above listed copyright holder(s) *
.\" not be used in advertising or publicity pertaining to distribution of the *
.\" software without specific, written prior permission. *
.\" *
.\" THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD *
.\" TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND *
.\" FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE *
.\" FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES *
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN *
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR *
.\" IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
.\" ***************************************************************************/
.\" $Id: add.1,v 1.11 2024/01/10 21:59:30 tom Exp $
.TH ADD 1 2024-01-10 "" "User commands"
.ie n .ds CW R
.el \{
.ie \n(.g .ds CW CR
.el .ds CW CW
.\}
.de NE
.fi
.ft R
.ie n .in -4
.el .in -2
..
.de NS
.ie n .sp
.el .sp .5
.ie n .in +4
.el .in +2
.nf
.ft \*(CW
..
.
.hy 0
.
.SH NAME
\fBadd\fR \-
full-screen editing calculator
.SH SYNOPSIS
\fBadd\fI [options] [file-specifications]\fR
.
.SH DESCRIPTION
\fBAdd\fR performs fixed-point computation.
It is designed for use as a checkbook or expense-account balancing tool.
.PP
\fBAdd\fR maintains a running result for each operation.
You may scroll to any position in the expression list and modify the list.
Enter data by typing numbers (with optional decimal point),
separated by operators.
.PP
An output transcript may be saved and reloaded for further editing.
Scripts are loaded from left to right (with the "output" processed first).
.
.SH OPTIONS
Command line options of \fBadd\fR are:
.
.TP
.B \-h
Prints the list of options.
.TP
.BI \-i " interval"
Sets compounding interval for interest computation.
.TP
.BI \-o " script"
Specify file in which to save output transcript.
.TP
.BI \-p " num"
Sets precision (number of digits after the decimal place).
.
.SH OPERATIONS
.
.SS "Computations:"
.
The operators are all single-character:
.
.TP
.B "+"
begins an addition
.TP
.B "-"
begins a subtraction
.TP
.B "~"
negates the result
.TP
.B "*"
begins a multiplication
.TP
.B "/"
begins a division
.TP
.B "%"
begins an interest computation (uses \fIinterval\fR): rate=number.
.TP
.B "$"
begins a sales-tax computation: rate=number.
.TP
.B "("
opening parenthesis.
This may enclose a unary '-', more parentheses, or data
(implicit unary '+').
.TP
.B ")"
closing parenthesis, expects another operator, not data.
.TP
.B "="
flushes out the current number, forces re-computation of the running result.
.TP
.B "w"
increases the width used for numbers by one column up to a platform-specific
value.
.TP
.B "W"
decreases the width used for numbers by one column, down to a minimum of 6.
.
.PP
A space flushes out the current number-input, and (by default) sets the
next operator to be the same as the current one.
You may repeat the last arithmetic operation of any type:
.
.TP
.B "a"
repeats the last '+' (default 0).
.TP
.B "s"
repeats the last '-' (default 0).
.TP
.B "n"
repeats the last '~'.
.TP
.B "m"
repeats the last '*' (default 1).
.TP
.B "d"
repeats the last '/' (default 1).
.TP
.B "i"
repeats the last '%' (default 4).
.TP
.B "t"
repeats the last '$' (default 4).
.
.PP
You may toggle the prefix operator of any number by typing a single
character:
.
.TP
.B "A"
toggles the operator to '+'.
.TP
.B "S"
toggles the operator to '-'.
.TP
.B "N"
toggles the operator to '~'.
.TP
.B "M"
toggles the operator to '*'.
.TP
.B "D"
toggles the operator to '/'.
.TP
.B "I"
toggles the operator to '%'.
.TP
.B "T"
toggles the operator to '$'.
.
.SS "Editing:"
.
As you enter data, you may edit it.
A backspace deletes the last digit
of the current number (if it is visible).
Use the arrow keys or
vi-style 'h' and 'l' to move left and right within the line.
Other editing commands include
.
.TP
.B "u"
undoes the last x/X command (restricted to restoring the
current data only).
.TP
.B "x"
deletes the current data.
If the data is null, deletes the following line.
.TP
.B "X"
deletes the current data.
If the data is null, deletes the preceding line and moves up.
.TP
.B "o"
opens a new line after the current line.
.TP
.B "O"
opens a new line before the current line.
.TP
.B "#"
edit the associated comment.
.
.PP
An "open" permits you to insert a new operator and data into the
expression list.
You may type an operator character (e.g., '+'), and
continue with the new data, or an operator-repeat (e.g., 'A').
In either case, you may edit the new data, just as you would the old data.
A 'u' (or other toggle, such as 'o', 'O', or 'q') typed after an open
will undo the open (and close it).
.
.SS "Scrolling/cursor movement:"
.
.TP
.B H
move to the top line on the screen.
.TP
.B M
move to the middle line on the screen.
.TP
.B L
move to the last line on the screen
.TP
.B CTL/F
scroll forward one screen.
.TP
.B CTL/B
scroll backward one screen.
.TP
.B j
move forward one line.
.TP
.B k
move backward one line.
.TP
.B z<CR>
move the current line to the top of the screen.
.TP
.B z.
move the current line to the middle of the screen.
.TP
.B z-
move the current line to the bottom of the screen.
.
.PP
Like \fBvi\fR,
\fBadd\fR allows you to jump to a particular line with a ":" command
.
.TP
.B :$
jumps to the last entry
.TP
.B :1
jumps to the first entry.
.
.SS "Scripts:"
.
Transcript files are formatted to permit line-oriented entries:
.
.NS
<operator><value><blank><ignored><blank># comment
.NE
.PP
The transcripts saved by \fBadd\fR contain the running result in the
"ignored" part.
To exit without saving a transcript, type 'Q'.
A
normal exit, by typing 'q', saves the list of operators, data (and
running result) in the specified file.
.PP
You can read and write scripts without leaving \fBadd\fR.
.
.TP
.BI :e " file"
clears the current script and reads a script from the file.
.TP
.B :f
shows the current script name.
.TP
.BI :r " file"
reads a script at the current entry
.TP
.BI :w " file"
writes a script to the specified file.
.
.SH ENVIRONMENT
\fBAdd\fR runs in a portable UNIX\*R environment.
.
.SH FILES
\fBAdd\fR is a single binary module, with a help file \fBadd.hlp\fR
installed in the same directory.
.
.SH BUGS
It would be nice to be able to change the precision within the program.
In particular, the interest and sales tax computations would be more
useful if their precision was independent of the running total.
.
.SH AUTHORS
Thomas E. Dickey
.
.SH SEE ALSO
\fBwc\fP(1),
\fBvi\fP(1)
|