VocalEasel/mma/docs/html/ref/node25.html

231 lines
6.6 KiB
HTML
Raw Normal View History

2009-05-17 22:34:44 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2006-11-10 08:07:56 +00:00
<!--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>
2009-05-17 22:34:44 +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="node26.html">
<LINK REL="previous" HREF="node24.html">
<LINK REL="up" HREF="mma.html">
<LINK REL="next" HREF="node26.html">
</HEAD>
<BODY bgcolor="#ffffff">
2009-05-17 22:34:44 +00:00
<DIV CLASS="navigation"><!--Navigation Panel-->
<A NAME="tex2html750"
2006-11-10 08:07:56 +00:00
HREF="node26.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2009-05-17 22:34:44 +00:00
<A NAME="tex2html748"
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>
2009-05-17 22:34:44 +00:00
<A NAME="tex2html742"
2006-11-10 08:07:56 +00:00
HREF="node24.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2009-05-17 22:34:44 +00:00
<B> Next:</B> <A NAME="tex2html751"
HREF="node26.html">Paths, Files and Libraries</A>
<B> Up:</B> <A NAME="tex2html749"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2009-05-17 22:34:44 +00:00
<B> Previous:</B> <A NAME="tex2html743"
HREF="node24.html">Begin/End Blocks</A>
2006-11-10 08:07:56 +00:00
<BR>
2009-05-17 22:34:44 +00:00
<BR></DIV>
2006-11-10 08:07:56 +00:00
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
2009-05-17 22:34:44 +00:00
<UL CLASS="ChildLinks">
<LI><A NAME="tex2html752"
HREF="node25.html#SECTION002510000000000000000">Doc</A>
<LI><A NAME="tex2html753"
HREF="node25.html#SECTION002520000000000000000">Author</A>
<LI><A NAME="tex2html754"
HREF="node25.html#SECTION002530000000000000000">DocVar</A>
2006-11-10 08:07:56 +00:00
</UL>
<!--End of Table of Child-Links-->
<HR>
2009-05-17 22:34:44 +00:00
<H1><A NAME="SECTION002500000000000000000">
Documentation Strings</A>
2006-11-10 08:07:56 +00:00
</H1>
<P>
2009-05-17 22:34:44 +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.
<P>
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>).
<P>
For some real-life examples of how to document your library files,
look at any of the library files supplied with this distribution.
<P>
<H1><A NAME="SECTION002510000000000000000"></A> <A NAME="sec-docs"></A>
<BR>
Doc
</H1>
2006-11-10 08:07:56 +00:00
<P>
2009-05-17 22:34:44 +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>
2009-05-17 22:34:44 +00:00
<B>Doc This is a documentation string! </B>
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
2007-04-29 06:47:40 +00:00
<P>
2009-05-17 22:34:44 +00:00
In most cases, D<SMALL>OC</SMALL>s are treated as C<SMALL>OMMENT</SMALL>s. However,
if the <SPAN CLASS="textit">-Dx</SPAN><A NAME="tex2html78"
HREF="#foot11649"><SUP><SPAN CLASS="arabic">25</SPAN>.<SPAN CLASS="arabic">1</SPAN></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>
2009-05-17 22:34:44 +00:00
For producing the <SPAN CLASS="textit">
<FONT Face="Serif" Color="Navy"><I>MMA</I></FONT> Standard Library Reference</SPAN> 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>
2009-05-17 22:34:44 +00:00
<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>
2009-05-17 22:34:44 +00:00
Note, the '-w' option has been used to suppress the printing of warning
messages.
<P>
<H1><A NAME="SECTION002520000000000000000">
Author</A>
</H1>
<P>
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>
2009-05-17 22:34:44 +00:00
<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>
2009-05-17 22:34:44 +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>
2009-05-17 22:34:44 +00:00
<H1><A NAME="SECTION002530000000000000000">
DocVar</A>
2006-11-10 08:07:56 +00:00
</H1>
<P>
2009-05-17 22:34:44 +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.
<P>
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>
2009-05-17 22:34:44 +00:00
<B>Begin DocVar
2007-04-29 06:47:40 +00:00
<BR>
2009-05-17 22:34:44 +00:00
ChordVoice Voice used in Chord tracks (defaults to Piano2).
2007-04-29 06:47:40 +00:00
<BR>
2009-05-17 22:34:44 +00:00
End
<BR>
2007-04-29 06:47:40 +00:00
<BR>
2009-05-17 22:34:44 +00:00
If NDef ChordVoice
<BR>
Set ChordVoice Piano2
<BR>
Endif </B>
2007-04-29 06:47:40 +00:00
</td></tr>
</Table>
2006-11-10 08:07:56 +00:00
<P>
2009-05-17 22:34:44 +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>
2009-05-17 22:34:44 +00:00
<BR><HR><H4>Footnotes</H4>
<DL>
<DT><A NAME="foot11649">...-Dx</A><A
HREF="node25.html#tex2html78"><SUP><SPAN CLASS="arabic">25</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A></DT>
<DD>See the <A HREF="node2.html#cmd-summary">command
summary</A>.
2006-11-10 08:07:56 +00:00
2009-05-17 22:34:44 +00:00
</DD>
</DL>
<DIV CLASS="navigation"><HR>
2006-11-10 08:07:56 +00:00
<!--Navigation Panel-->
2009-05-17 22:34:44 +00:00
<A NAME="tex2html750"
2006-11-10 08:07:56 +00:00
HREF="node26.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
2009-05-17 22:34:44 +00:00
<A NAME="tex2html748"
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>
2009-05-17 22:34:44 +00:00
<A NAME="tex2html742"
2006-11-10 08:07:56 +00:00
HREF="node24.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<BR>
2009-05-17 22:34:44 +00:00
<B> Next:</B> <A NAME="tex2html751"
HREF="node26.html">Paths, Files and Libraries</A>
<B> Up:</B> <A NAME="tex2html749"
2006-11-10 08:07:56 +00:00
HREF="mma.html">Reference Manual</A>
2009-05-17 22:34:44 +00:00
<B> Previous:</B> <A NAME="tex2html743"
HREF="node24.html">Begin/End Blocks</A></DIV>
2006-11-10 08:07:56 +00:00
<!--End of Navigation Panel-->
<ADDRESS>
2007-04-29 06:47:40 +00:00
bob
2009-05-17 22:34:44 +00:00
2008-09-28
2006-11-10 08:07:56 +00:00
</ADDRESS>
</BODY>
</HTML>