2006-11-10 08:07:56 +00:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
|
|
|
|
|
|
<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
|
|
|
|
original version by: Nikos Drakos, CBLU, University of Leeds
|
|
|
|
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
|
|
|
* with significant contributions from:
|
|
|
|
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
|
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
2007-04-29 06:47:40 +00:00
|
|
|
<TITLE>Documentation Strings</TITLE>
|
|
|
|
<META NAME="description" CONTENT="Documentation Strings">
|
2006-11-10 08:07:56 +00:00
|
|
|
<META NAME="keywords" CONTENT="mma">
|
|
|
|
<META NAME="resource-type" CONTENT="document">
|
|
|
|
<META NAME="distribution" CONTENT="global">
|
|
|
|
|
|
|
|
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
|
|
|
|
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
|
|
|
|
|
|
|
<LINK REL="STYLESHEET" HREF="mma.css">
|
|
|
|
|
|
|
|
<LINK REL="next" HREF="node24.html">
|
|
|
|
<LINK REL="previous" HREF="node22.html">
|
|
|
|
<LINK REL="up" HREF="mma.html">
|
|
|
|
<LINK REL="next" HREF="node24.html">
|
|
|
|
</HEAD>
|
|
|
|
|
|
|
|
<BODY bgcolor="#ffffff">
|
|
|
|
<!--Navigation Panel-->
|
2007-04-29 06:47:40 +00:00
|
|
|
<A NAME="tex2html695"
|
2006-11-10 08:07:56 +00:00
|
|
|
HREF="node24.html">
|
|
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
|
2007-04-29 06:47:40 +00:00
|
|
|
<A NAME="tex2html693"
|
2006-11-10 08:07:56 +00:00
|
|
|
HREF="mma.html">
|
|
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
|
2007-04-29 06:47:40 +00:00
|
|
|
<A NAME="tex2html687"
|
2006-11-10 08:07:56 +00:00
|
|
|
HREF="node22.html">
|
|
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
|
|
|
|
<BR>
|
2007-04-29 06:47:40 +00:00
|
|
|
<B> Next:</B> <A NAME="tex2html696"
|
|
|
|
HREF="node24.html">Paths, Files and Libraries</A>
|
|
|
|
<B> Up:</B> <A NAME="tex2html694"
|
2006-11-10 08:07:56 +00:00
|
|
|
HREF="mma.html">Reference Manual</A>
|
2007-04-29 06:47:40 +00:00
|
|
|
<B> Previous:</B> <A NAME="tex2html688"
|
|
|
|
HREF="node22.html">Begin/End Blocks</A>
|
2006-11-10 08:07:56 +00:00
|
|
|
<BR>
|
|
|
|
<BR>
|
|
|
|
<!--End of Navigation Panel-->
|
|
|
|
<!--Table of Child-Links-->
|
|
|
|
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
|
|
|
|
|
|
|
|
<UL>
|
|
|
|
<LI><A NAME="tex2html697"
|
2007-04-29 06:47:40 +00:00
|
|
|
HREF="node23.html#SECTION002310000000000000000">Doc</A>
|
2006-11-10 08:07:56 +00:00
|
|
|
<LI><A NAME="tex2html698"
|
2007-04-29 06:47:40 +00:00
|
|
|
HREF="node23.html#SECTION002320000000000000000">Author</A>
|
2006-11-10 08:07:56 +00:00
|
|
|
<LI><A NAME="tex2html699"
|
2007-04-29 06:47:40 +00:00
|
|
|
HREF="node23.html#SECTION002330000000000000000">DocVar</A>
|
2006-11-10 08:07:56 +00:00
|
|
|
</UL>
|
|
|
|
<!--End of Table of Child-Links-->
|
|
|
|
<HR>
|
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
<H1><A NAME="SECTION002300000000000000000">
|
|
|
|
Documentation Strings</A>
|
2006-11-10 08:07:56 +00:00
|
|
|
</H1>
|
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
It has been mentioned a few times already the importance of clearly
|
|
|
|
documenting your files and library files. For the most part, you can
|
|
|
|
use comments in your files; but in library files you use the
|
|
|
|
D<SMALL>OC</SMALL> directive.
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
In addition to the commands listed in this chapter, you should also
|
|
|
|
note <A HREF="node6.html#sec-grooves">D<SMALL>EF</SMALL>G<SMALL>ROOVES</SMALL></A>).
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
For some real-life examples of how to document your library files,
|
|
|
|
look at any of the library files supplied with this distribution.
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
<H1><A NAME="SECTION002310000000000000000"></A> <A NAME="sec-docs"></A>
|
2006-11-10 08:07:56 +00:00
|
|
|
<BR>
|
2007-04-29 06:47:40 +00:00
|
|
|
Doc
|
2006-11-10 08:07:56 +00:00
|
|
|
</H1>
|
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
A D<SMALL>OC</SMALL> command is pretty simple:
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
|
|
|
|
<tr><td>
|
|
|
|
<B>Doc This is a documentation string! </B>
|
2006-11-10 08:07:56 +00:00
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
</td></tr>
|
|
|
|
</Table>
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
In most cases, D<SMALL>OC</SMALL>s are treated as C<SMALL>OMMENT</SMALL>s. However,
|
|
|
|
if the <I>-Dx</I><A NAME="tex2html68"
|
|
|
|
HREF="#foot10621"><SUP>23.1</SUP></A> option is given
|
|
|
|
on the command line, D<SMALL>OC</SMALL>s are processed and printed to standard
|
|
|
|
output.
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
For producing the <I>
|
|
|
|
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> Standard Library Reference</I> a trivial
|
|
|
|
Python program is used to collate the output generated with a command
|
|
|
|
like:
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
|
|
|
|
<tr><td>
|
|
|
|
<B>$ mma -Dxl -w /usr/local/lib/mma/swing </B>
|
2006-11-10 08:07:56 +00:00
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
</td></tr>
|
|
|
|
</Table>
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
Note, the '-w' option has been used to suppress the printing of warning
|
|
|
|
messages.
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
<H1><A NAME="SECTION002320000000000000000">
|
|
|
|
Author</A>
|
2006-11-10 08:07:56 +00:00
|
|
|
</H1>
|
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
As part of the documentation package, there is a A<SMALL>UTHOR</SMALL>
|
|
|
|
command:
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
|
|
|
|
<tr><td>
|
|
|
|
<B>Author Bob van der Poel </B>
|
2006-11-10 08:07:56 +00:00
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
</td></tr>
|
|
|
|
</Table>
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
Currently A<SMALL>UTHOR</SMALL> lines are processed and the data is saved, but
|
|
|
|
never used. It may be used in a future library documentation
|
|
|
|
procedures, so you should use it in any library files you write.
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
<H1><A NAME="SECTION002330000000000000000">
|
|
|
|
DocVar</A>
|
2006-11-10 08:07:56 +00:00
|
|
|
</H1>
|
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
If any variables are used to change the behavior of a library file
|
|
|
|
they should be documented with a D<SMALL>OC</SMALL>V<SMALL>AR</SMALL> command. Normally these
|
|
|
|
lines are treated as comments, but when processing with the -Dxl or
|
|
|
|
-Dxh command line options the data is parsed and written to the output
|
|
|
|
documentation files.
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
Assuming that you are using the
|
|
|
|
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> variable $C<SMALL>HORD</SMALL>V<SMALL>OICE</SMALL> as
|
|
|
|
an optional voice setting in your file, you might have the following
|
|
|
|
in a library file:
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
<Table Hspace="40%" CellSpacing=0 CellPadding=10 BGColor="OldLace" Border=3>
|
|
|
|
<tr><td>
|
|
|
|
<B>Begin DocVar
|
2006-11-10 08:07:56 +00:00
|
|
|
<BR>
|
2007-04-29 06:47:40 +00:00
|
|
|
ChordVoice Voice used in Chord tracks (defaults to Piano2).
|
2006-11-10 08:07:56 +00:00
|
|
|
<BR>
|
2007-04-29 06:47:40 +00:00
|
|
|
End
|
|
|
|
<BR>
|
2006-11-10 08:07:56 +00:00
|
|
|
<BR>
|
2007-04-29 06:47:40 +00:00
|
|
|
If NDef ChordVoice
|
2006-11-10 08:07:56 +00:00
|
|
|
<BR>
|
2007-04-29 06:47:40 +00:00
|
|
|
Set ChordVoice Piano2
|
2006-11-10 08:07:56 +00:00
|
|
|
<BR>
|
2007-04-29 06:47:40 +00:00
|
|
|
Endif </B>
|
2006-11-10 08:07:56 +00:00
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
</td></tr>
|
|
|
|
</Table>
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
All variables used in the library file should be documented. You
|
|
|
|
should list the user variables first, and then any variables internal
|
|
|
|
to the library file. To double check to see what variables are used
|
|
|
|
you can add a S<SMALL>HOW</SMALL>V<SMALL>ARS</SMALL> to the end of the library file and
|
|
|
|
compile. Then document the variables and remove the S<SMALL>HOW</SMALL>V<SMALL>ARS</SMALL>.
|
2006-11-10 08:07:56 +00:00
|
|
|
|
|
|
|
<P>
|
2007-04-29 06:47:40 +00:00
|
|
|
<BR><HR><H4>Footnotes</H4>
|
|
|
|
<DL>
|
|
|
|
<DT><A NAME="foot10621">...-Dx</A><A
|
|
|
|
HREF="node23.html#tex2html68"><SUP>23.1</SUP></A></DT>
|
|
|
|
<DD>See the <A HREF="node2.html#cmd-summary">command
|
|
|
|
summary</A>.
|
2006-11-10 08:07:56 +00:00
|
|
|
|
2007-04-29 06:47:40 +00:00
|
|
|
</DD>
|
|
|
|
</DL><HR>
|
2006-11-10 08:07:56 +00:00
|
|
|
<!--Navigation Panel-->
|
2007-04-29 06:47:40 +00:00
|
|
|
<A NAME="tex2html695"
|
2006-11-10 08:07:56 +00:00
|
|
|
HREF="node24.html">
|
|
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
|
2007-04-29 06:47:40 +00:00
|
|
|
<A NAME="tex2html693"
|
2006-11-10 08:07:56 +00:00
|
|
|
HREF="mma.html">
|
|
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
|
2007-04-29 06:47:40 +00:00
|
|
|
<A NAME="tex2html687"
|
2006-11-10 08:07:56 +00:00
|
|
|
HREF="node22.html">
|
|
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
|
|
|
|
<BR>
|
2007-04-29 06:47:40 +00:00
|
|
|
<B> Next:</B> <A NAME="tex2html696"
|
|
|
|
HREF="node24.html">Paths, Files and Libraries</A>
|
|
|
|
<B> Up:</B> <A NAME="tex2html694"
|
2006-11-10 08:07:56 +00:00
|
|
|
HREF="mma.html">Reference Manual</A>
|
2007-04-29 06:47:40 +00:00
|
|
|
<B> Previous:</B> <A NAME="tex2html688"
|
|
|
|
HREF="node22.html">Begin/End Blocks</A>
|
2006-11-10 08:07:56 +00:00
|
|
|
<!--End of Navigation Panel-->
|
|
|
|
<ADDRESS>
|
2007-04-29 06:47:40 +00:00
|
|
|
bob
|
|
|
|
2007-03-07
|
2006-11-10 08:07:56 +00:00
|
|
|
</ADDRESS>
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|