📄 0264-0266.html
字号:
<HTML>
<HEAD>
<TITLE>Developer.com - Online Reference Library - 0672311623:SAMS TEACH YOURSELF LINUX IN 24 HOURS:Learning Math and Financial Tools</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311623 //-->
<!-- TITLE=SAMS TEACH YOURSELF LINUX IN 24 HOURS //-->
<!-- AUTHOR=BILL BALL, STEPHEN SMOOGEN //-->
<!-- PUBLISHER=MACMILLAN //-->
<!-- IMPRINT=SAMS //-->
<!-- PUBLICATION DATE=1998 //-->
<!-- CHAPTER=17 //-->
<!-- PAGES=0259-0270 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0259-0263.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0267-0270.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-264"><P>Page 264</P></A>
<!-- CODE //-->
<PRE>...
Initial balance? 2500.00
current balance = 2500.00
transaction? 49.95
current balance = 2450.05
transaction? 32.18
current balance = 2417.87
transaction?
...
</PRE>
<!-- END CODE //-->
<P>This is only one way to use the bc command's language. With a little effort, you can
write your own. But if you'd rather use more complex programs to perform calculations,
you know that you should use a spreadsheet application. The next section discusses the
variety of spreadsheets for Linux.
</P>
<H3><A NAME="ch17_ 10">
Spreadsheets
</A></H3>
<P>Spreadsheet programs offer a convenient way to store and manipulate financial or
scientific data. You can use these programs to help manage your home or a business. Typical
uses involve personal finance, such as tracking loans and investments, or running
business inventory control, personnel worksheets, or accounting tasks.
</P>
<P>You can also use these programs to do forecasting, or "what if" calculations. This can
help you create estimates you can use for home mortgages, auto loans, and even
home construction. You're limited only in your imagination with most of these programs,
and many not only offer the ability to work as a whiz-bang calculator, but will also create
graphic charts so you can graph your data visually.
</P>
<P>Although you won't find any of these programs on your CD-ROM, once you've
connected to your ISP (see Hour 10, "Connecting to the Internet"), you can use the lynx Web
browser or your downloaded copy of Netscape to get copies or more information about them.
If you need to have a spreadsheet program to use with Linux, you're in luck, because at
least a dozen are available, and nearly half come with source code so you can make changes,
add features, or fix problems.
</P>
<H4><A NAME="ch17_ 11">
Using the Public Domain sc Spreadsheet
</A></H4>
<P>The sc (spreadsheet calculator) command (see Figure 17.3) is a freely available,
public domain spreadsheet program. This program is a collective work of nearly 60
programmers, and runs on many different UNIX systems. With a little effort in learning its
commands, you'll be able to build very capable spreadsheets. The
sc program is free, and it comes with source code. A short tutorial and manual page documenting its features is included.
</P>
<P>This program is especially handy if you're running Linux on a small hard drive and
disk space is at a premium. The sc program requires only about 120 kilobytes of disk space,
but provides a lot of features.
</P>
<A NAME="PAGENUM-265"><P>Page 265</P></A>
<P>Using the sc program is easy. You can load programs from the command line when you
start it, or you can load and save programs while it's running. You can run this program
as follows:
</P>
<!-- CODE SNIP //-->
<PRE>
# sc
</PRE>
<!-- END CODE SNIP //-->
<P>If you'd like a quick reference to the sc commands, use the
sc companion command (included with the source code), the
scqref command, and pipe the output through the
nroff
</P>
<P>Figure 17.3.<BR>
The sc spreadsheet<BR> calculator works with<BR> or without the
X<BR> Window System, and<BR> it comes with a short<BR> tutorial.<BR>
<a href="javascript:displayWindow('images/ch17fg03.jpg', 288, 216)"><img src="images/tn_ch17fg03.jpg"></a><BR>
</P>
<P>and less commands. Then either read at your leisure, or redirect to a file you can edit
and print, for example:
</P>
<!-- CODE SNIP //-->
<PRE>
# scqref | nroff -man | less > scref.txt
</PRE>
<!-- END CODE SNIP //-->
<P>To learn how to use the sc spreadsheet program, load the
sc program's tutorial, which you'll find under the
/usr/lib/sc directory:
</P>
<!-- CODE SNIP //-->
<PRE>
# sc /usr/lib/sc/tutorial.sc
</PRE>
<!-- END CODE SNIP //-->
<P>This will run sc and load the tutorial. An included program, called
psc, can help you import text-only data files by converting word processor or other spreadsheet program files.
The sc program has more than 60 built-in functions, and because you get the source code,
you can add your own. One place to find the source code to the
sc spreadsheet is
</P>
<!-- CODE SNIP //-->
<PRE>
<a href="http://www.cdrom.com/pub/linux/slackware_source/ap/sc">
http://www.cdrom.com/pub/linux/slackware_source/ap/sc</A>
</PRE>
<!-- END CODE SNIP //-->
<H4><A NAME="ch17_ 12">
Plotting Graphics with the X11 xspread Spreadsheet
</A></H4>
<A NAME="PAGENUM-266"><P>Page 266</P></A>
<P>If you like the sc spreadsheet program, but would like updated menus and features, you
may want to try the xspread program, by software engineering teams at the University
of Wisconsin-Milwaukee. This program requires that you're running X11, but offers
these additional features:
</P>
<UL>
<LI> An improved program menu
<LI> Mouse support to run program features
<LI> The ability to import Lotus 1-2-3 format files
<LI> Support to generate and display line, bar, stacked-bar, and pie chart
graphics from spreadsheet data
</UL>
<P>The xspread program works the same way as the
sc spreadsheet program. You can use this program with any
sc spreadsheets you've devised. Along with the sc tutorial, you'll find
an expanded manual detailing the xspread improvements.
</P>
<P>You can also generate graphics with the xspread program. By
selecting Graph, then defining a label range of cells, and a data range of cells, you can quickly generate
visual representations of your data. To print your charts, capture the chart window with the
xv command (see Hour 16, "Graphics Tools").
</P>
<P>Unlike sc, this program appears to be distributed under the GNU General Public
License, even though its manual page states that
xspread is in the public domain. This means that
the software is free, and you can make any changes you want, but you cannot claim the
program as your own. One source of the xspread spreadsheet package is at this location:
</P>
<!-- CODE //-->
<PRE>
<a href="http://www.cdrom.com/pub/linux/slackware_source/xap/xspread">
http://www.cdrom.com/pub/linux/slackware_source/xap/xspread</A>
</PRE>
<!-- END CODE //-->
<H4><A NAME="ch17_ 13">
Finding and Using the teapot Spreadsheet
</A></H4>
<P>As an alternative to the sc program, you might want to try the
teapot (table editor and planner) spreadsheet program by Michael Haardt. This spreadsheet works under X11 or
your console. The program's menu appears at the bottom of your screen, where you'll find
nearly all of the features of sc and xspread. The
teapot program also has these features:
</P>
<UL>
<LI> Import of sc and .WK1 spreadsheet files
<LI> Export of CSV, HTML, LaTeX, or ASCII file formats
<LI> Three-dimensional spreadsheets
<LI> Extensive and customized support of keyboard function keys
<LI> Availability in German, English, or Dutch language versions
</UL>
<P>Although the teapot program does not have the graphics features of the
xspread version of the sc spreadsheet, you'll find that the
teapot spreadsheet has much better documentation, including example programs, and an extensive tutorial that takes you from the concept of
</P>
<P><CENTER>
<a href="0259-0263.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0267-0270.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -