File:
[LON-CAPA] /
loncom /
html /
adm /
help /
tex /
Calling_Functions.tex
Revision
1.1:
download - view:
text,
annotated -
select for diffs
Fri Jul 5 16:12:31 2002 UTC (22 years, 2 months ago) by
bowersj2
Branches:
MAIN
CVS tags:
HEAD
This commit implements the .tex-based online help system in LON-CAPA. It
may be necessary to manually run loncom/build/help_graphics_converter.pl
and doc/help/rebuildLabelHash.pl after a cvs update, and
loncapa_apache.conf may need to be manually copied to /etc. (The
loncapafiles.lpml has been updated.)
After merging this, the URL http://[loncapahost]/adm/help/Foils.hlp
should display a help file.
Also, some *very* out-of-date files have been removed from the /doc
directory.
With variables, you can store strings or numbers. \textbf{Functions} allow
you to manipulate these strings or numbers. Functions work like mathematical
functions: They take some number of arguments in, and return one argument,
usually a number or a string for our purposes. There are a lot of functions
available in LON-CAPA. You can see a complete list at http://mileva.lite.msu.edu/loncapadocs/homework/homework5.html.
For now, let's just look at some simple examples.
%
\begin{figure}
\begin{lyxcode}
\$a~=~-3.0;
\$b~=~\&sin(\$a);
\$c~=~\&pow(3.0,~\&abs(\$a));
\end{lyxcode}
\caption{Some Function Calls\label{Some Function Calls Figure}}
\end{figure}
In the \textbf{Script} block, function names start with \textbf{\&}. Some
example function calls are shown in figure \ref{Some Function Calls Figure}.
You can see that functions can take either variables, numbers, or the results
of other function calls as parameters. The \texttt{\&sin} function returns
the sine of an angle expressed in radians. \texttt{\&pow} raises the first
parameter to the power of the second parameter. \texttt{\&abs} returns the
absolute value of the argument.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>