📄 sc.1
字号:
.fi.\" ==========.SS "Built-in Range Functions".\" ----------These functions return numeric values..\" ----------.TP 18.BR @sum (r)Sum all valid (nonblank) entries in the regionwhose two corners are defined by the two variable names (e.g..IR c5:e14 )or the range name specified..\" ----------.TP 18.BR @prod (r)Multiply together all valid (nonblank) entries in the specified region..\" ----------.TP 18.BR @avg (r)Average all valid (nonblank) entries in the specified region..\" ----------.TP 18.BR @count (r)Count all valid (nonblank) entries in the specified region..\" ----------.TP 18.BR @max (r)Return the maximum value in the specified region. See also the multi argumentversion of.I @maxbelow..\" ----------.TP 18.BR @min (r)Return the minimum value in the specified region. See also the multi argumentversion of.I @minbelow..\" ----------.TP 18.BR @stddev (r)Return the sample standard deviation of the cells in the specified region..\" ----------.TP 18.BR @lookup (e,r).PD 0.TP 18.BR @lookup (se,r).PDEvaluates the expression then searches through the range.I rfor a matching value.The range should be either a single row or a single column.The expression can be either a stringexpression or a numeric expression. If it is a numeric expression,the range is searched for the the last value less than or equal to .IR e .If the expression is a string expression, the string portionsof the cells in the range are searched for an exact string match.The value returned is the numeric value from the next row and the samecolumn as the match, if the range was a single row, or the value fromthe next column and the same row as the match if the range was a singlecolumn..\" ----------.TP 18.BR @hlookup (e,r,n).PD 0.TP 18.BR @hlookup (se,r,n).PDEvaluates the expression then searches through the first row in the range.I rfor a matching value.The expression can be either a stringexpression or a numeric expression. If it is a numeric expression,the row is searched for the the last value less than or equal to .IR e .If the expression is a string expression, the string portionsof the cells in the row are searched for an exact string match.The value returned is the numeric value from the same column.I nrows below the match..\" ----------.TP 18.BR @vlookup (e,r,n).PD 0.TP 18.BR @vlookup (se,r,n).PDEvaluates the expression then searches through the first column in the range.I rfor a matching value.The expression can be either a stringexpression or a numeric expression. If it is a numeric expression,the column is searched for the the last value less than or equal to .IR e .If the expression is a string expression, the string portionsof the cells in the column are searched for an exact string match.The value returned is the numeric value from the same row.I ncolumns to the right of the match..\" ----------.TP 18.BR @index (e,r)Use the value of the expression .I eto index intothe range.IR r .The numeric value at that position is returned. The value 1 selects the first item in the range,2 selects the second item, etc..I Rshould be either a single row or a singlecolumn..\" ----------.TP 18.BR @stindex (e,r)Use the value of .I eto index intothe range.IR r .The string value at that position is returned. The value 1 selects the first item in the range,2 selects the second item, etc.The range should be either a single row or a singlecolumn..\" ==========.SS "Built-in Numeric Functions".\" ----------All of these functions operate on floating point numbers (doubles)and return numeric values.Most of them are standard system functions more fully described in.IR math (3).The trig functions operate with angles in radians..\" ----------.TP 18.BR @sqrt (e)Return the square root of.IR e ..\" ----------.TP 18.BR @exp (e)Return the exponential function of.IR e ..\" ----------.TP 18.BR @ln (e)Return the natural logarithm of.IR e ..\" ----------.TP 18.BR @log (e)Return the base 10 logarithm of.IR e ..\" ----------.TP 18.BR @floor (e)Return the largest integer not greater than.IR e ..\" ----------.TP 18.BR @ceil (e)Return the smallest integer not less than.IR e ..\" ----------.TP 18.BR @rnd (e)Round.I eto the nearest integer..TP 18.BR @round (e,n)Round.I eto.I ndecimal places..\" ----------.TP 18.BR @abs (e).PD 0.TP 18.BR @fabs (e)Return the absolute value of.IR e ..\" ----------.TP 18.BR @pow (e1,e2)Return.I e1raised to the power of.IR e2 ..\" ----------.TP 18.BR @hypot (e1,e2)Return sqrt(e1\(**e1+e2\(**e2), taking precautions against unwarrantedoverflows..\" ----------.TP 18.B piA constant quite close to pi..\" ----------.TP 18.BR @dtr (e)Convert.I ein degrees to radians..\" ----------.TP 18.BR @rtd (e)Convert.I ein radians to degrees..\" ----------.TP 18.BR @sin (e).PD 0.TP 18.BR @cos (e).TP 18.BR @tan (e)Return trigonometric functions of radian arguments.The magnitude of the arguments are not checked to assure meaningful results..PD.\" ----------.TP 18.BR @asin (e)Return the arc sine of.I ein the range -pi/2 to pi/2..\" ----------.TP 18.BR @acos (e)Return the arc cosine of.I ein the range 0 to pi..\" ----------.TP 18.BR @atan (e)Return the arc tangent of.I ein the range -pi/2 to pi/2..\" ----------.TP 18.BR @atan2 (e1,e2)Returns the arc tangent of.IR e1 / e2in the range -pi to pi..\" ----------.TP 18.BR @max (e1,e2,...)Return the maximum of the values of the expressions. Two or more expressionsmay be specified. See also the range version of .I @maxabove..\" ----------.TP 18.BR @min (e1,e2,...)Return the minimum of the values of the expressions. Two or more expressionsmay be specified. See also the range version of .I @minabove..\" ----------.TP 18.BR @ston (se)Convert string expression.I seto a numeric value..\" ----------.TP 18.BR @eqs (se1,se2)Return 1 if string expression.I se1has the same value as string expression.IR se2 ,0 otherwise..\" ----------.TP 18.BR @nval (se,e)Return the numeric value of a cell selected by name.String expression.I semust evaluate to a column name (``A''-``AE'') and.I emust evaluate to a row number (0-199). If.I seor.I eis out of bounds, or the cell has no numeric value, the result is 0.You can use this for simple table lookups.Be sure the table doesn't move unexpectedly!See also.IR @sval ()below..\" ==========.SS "String Expressions".\" ----------String expressions are made up of constant strings(characters surrounded by double quotation marks),variables(cell names, which refer to the cells's label strings or expressions),and string functions.Note that string expressions are only allowedwhen entering a cell's label string, not its numeric part.Also note that string expression results may be left or right flushed,according to the type of the cell's string label..\" ----------.TP.B #Concatenate strings.For example, the string expression.IP "" A0 # "zy dog".IP ""displays the string ``the lazy dog'' in the cell if the value of.IR A0 'sstring is ``the la''..\" ==========.SS "Built-in String Functions".\" ----------\0 \" exactly one blank line (hard to get).PD 0.TP 18.BR @substr (se,e1,e2)Extract and return from string expression.I sethe substring indexed by character number.I e1through character number.I e2(defaults to the size of.I seif beyond the end of it).If.I e1is less than 1 or greater than.IR e2 ,the result is the null string.For example,.PD.IP "" @substr ("Nice jacket", 4, 7).IP ""returns the string ``e jac''..\" ----------.TP 18.BR @fmt (se,e)Convert a number to a string.The argument.I semust be a valid.IR printf (3)format string..I eis converted according to the standard rules.For example, the expression.IP "" @fmt ("\(**\(**%6.3f\(**\(**", 10.5).IP ""yields the string ``\(**\(**10.500\(**\(**''..I eis a double, so applicable formats are e, E, f, g, and G.Try ``%g'' as a starting point..\" ----------.TP 18.BR @sval (se,e)Return the string value of a cell selected by name.String expression.I semust evaluate to a column name (``A''-``AE'') and.I emust evaluate to a row number (0-199). If.I seor.I eis out of bounds, or the cell has no string value,the result is the null string.You can use this for simple table lookups.Be sure the table doesn't move unexpectedly!.\" ----------.TP 18.BR @ext (se,e)Call an external function (program or script).The purpose is to allow arbitrary functions on values,e.g. table lookups and interpolations.String expression.I seis a command or command line to call with.IR popen (3).The value of.I eis converted to a string and appended to the command line as an argument.The result of.IR @ext ()is a string:the first line printed to standard output by the command.The command should emit exactly one output line.Additional output, or output to standard error, messes up the screen..IR @ext ()returns a null string and prints an appropriate warningif external functions are disabled,.I seis null, or the attempt to run the command fails..IP ""External functions can be slow to run,and if enabled are called at each screen update,so they are disabled by default.You can enable them with.I ^Twhen you really want them called..IP ""A simple example:.IP "" @ext ("echo", a1).IP ""You can use.IR @ston ()to convert the.IR @ext ()result back to a number.For example:.IP "" @ston (@ext ("form.sc.ext", a9 + b9)).IP ""Note that you can built a command line (including more argument values)from a string expression with concatenation.You can also "hide" the second argument by ending the command line(first argument) with `` #'' (shell comment)..\" ==========.SS "Built-in Financial Functions".\" ----------Financial functions compute the mortgage (or loan) payment, future value,and the present value functions. Each acceptsthree arguments, an amount, a rate of interest (per period), and the number of periods.These functions are the same as those commonly found in other spreadsheetsand financial calculators.\" ----------.TP 18.BR @pmt (e1,e2,e3).IR @pmt (60000,.01,360)computes the monthly payments for a $60000 mortgage at 12% annual interest(.01 per month) for 30 years (360 months)..\" ----------.TP 18.BR @fv (e1,e2,e3).IR @fv (100,.005,36)computes the future value for of 36 monthly payments of $100 at 6% interest (.005 per month). It answers the question: "How muchwill I have in 36 months if I deposit $100 per month in a savingsaccount paying 6% interest compounded monthly?".\" ----------.TP 18.BR @pv (e1,e2,e3).IR @pv (1000,.015,36)computes the present value of an a ordinary annuity of36 monthly payments of $1000 at 18% annual interest.It answers the question: "How much can I borrow at 18% for 30 yearsif I pay $1000 per month?".\" ==========.SS "Built-in Date and Time Functions".\" ----------Time for.I scfollows the system standard:the number of seconds since 1970.All date and time functions except.IR @date ()return numbers, not strings..\" ----------.TP 18.B @nowReturn the current time encodedas the number of seconds since the beginning of theepoch (December 31, 1969, midnight, GMT.).\" ----------.TP 18.BR @dts (e1,e2,e3).IR @dts (9,14,1988)converts the date September 14, 1988to the number of seconds from the epochto the first second of 9/14/88, local time.For example,.IR @date ( @dts (12,14,1976))yields.IP "".I " Tue Dec 14 00:00:00 1976".IP ""The month should be range from 1 to 12, the day should range from1 to the number of days in the specified month, and the year shouldrange from 1970 to 1999..\" ----------.TP 18.BR @tts (e1,e2,e3).IR @tts (8,20,45)converts the time 8:40:45 to the number of seconds sincemidnight, the night before. The hour should range from 0 to 23;the minutes and seconds should range from 0 to 59..\" ----------.PPThe following functions take the time in seconds(e.g. from.IR @now )as an argument and return the specified value.The functions all convert from GMT to local time..\" ----------.TP 18.BR @date (e)Convert the time in seconds to a date string24 characters long in the following form:.IP "".I " Sun Sep 16 01:03:52 1973".IP ""Note that you can extract parts of this fixed-format string with.IR @substr ()..\" ----------.TP 18.BR @year (e)Return the year.Valid years begin with 1970.The last legal year is system dependent..\" ----------.TP 18.BR @month (e)Return the month, encoded as 1 (January) to 12 (December)..\" ----------.TP 18.BR @day (e)Return the day of the month, encoded as 1 to 31..\" ----------.TP 18.BR @hour (e)Return the number of hours since midnight, encoded as 0 to 23..\" ----------.TP 18.BR @minute (e)Return the number of minutes since the last full hour, encoded as 0 to 59..\" ----------.TP 18.BR @second (e)Return the number of seconds since the last full minute, encoded as 0 to 59..\" ==========.SS "Spreadsheet Update".\" ----------Re-evaluation of spreadsheet expressionsis done by row or by column depending on the selected calculation order.Evaluation is repeated up to .I iterationstimes for each update if necessary,so forward references usually work as expected. See.I setabove.If stability is not reached after ten iterations,a warning is printed.This is usually due to a long series of forward references,or to unstable cyclic references (for example, set.IR A0 'sexpression to ``A0+1'')..\" ==========.SH SEE ALSObc(1), dc(1), crypt(1).\" ==========.SH BUGSTop-to-bottom, left-to-right evaluation of expressions is silly.A proper following of the dependency graphwith (perhaps) recourse to relaxation should be implemented..\" ----------.PPEditing is crude.All you can do is backspace over and retype text to be altered.There is no easy way to switch a leftstring to a rightstring or vice versa.Of course, you can always write the spreadsheet to a file with.IR Put ,edit it by calling an editor on the file with ``!'',and read it back with.I Get-- if you are comfortable editing spreadsheet files..\" ----------.PPOnly one previous value is saved from any call of.IR @ext ().If it is used more than once in a spreadsheetand external functions are enabled and later disabled,the last returned value pops up in several places..\" ----------.PPOn some systems,if the cell cursor is in column 0 with topline enabled(so the current cell is highlighted),or if any cell in column 0 is highlighted,the corresponding row number gets displayed and then blankedduring a screen refresh.This looks like a bug in.IR curses ..\" ----------.PPMany commands give no indication (a message or beep) if they have null effect.Some should give confirmation of their action, but they don't.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -