File:  [LON-CAPA] / loncom / html / adm / help / tex / Numerical_Response_Simple_Example.tex
Revision 1.3: download - view: text, annotated - select for diffs
Tue Feb 15 14:55:39 2005 UTC (19 years, 4 months ago) by vandui11
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_X, version_2_5_99_1, version_2_5_99_0, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_X, version_2_3_99_0, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_X, version_2_2_99_1, version_2_2_99_0, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_X, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, version_2_1_99_0, version_2_1_3, version_2_1_2, version_2_1_1, version_2_1_0, version_2_11_0_RC1, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, version_2_0_X, version_2_0_99_1, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, bz6209-base, bz6209, bz5969, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3, GCI_2, GCI_1, BZ5971-printing-apage, BZ5434-fox, BZ4492-merge, BZ4492-feature_horizontal_radioresponse
punctuation fixed

\label{Numerical_Response_Simple_Example}

A script consists of several \textbf{statements}, separated by \textbf{semi-colons}.
A \textbf{statement\index{statement}} is the smallest kind of instruction
to the computer. Most problems will be built from several statements. 

A script can contain \textbf{comments}, which are not interpreted as statements
by the computer. Comments start with \textbf{\#} and go to the end of that
line. Thus, if a line starts with \#, the whole line is ignored. Comments
can also begin in the middle of a line. It is a good idea to comment more
complicated scripts, as it can be very difficult to read a large script and
figure out what it does. It is a \emph{very} good idea to adopt some sort
of commenting standard, especially if you are working in a group or you believe
other people may use your problems in the future.

\begin{itemize}
\item One of the simplest statements in LON-CAPA is a \textbf{variable assignment}.
A \textbf{variable} can hold any value in it. The variable name must start
with a \textbf{\$}. In the \textbf{Script}, you need to assign to variables
before you use them. Put this program into the \textbf{Script} field of the
Numerical Response:

\begin{lyxcode}
\$variable~=~3;
\end{lyxcode}
This creates a variable named \textbf{variable} and assigns it the value
of {}``3''. That's one statement.

\end{itemize}
Variable names are \emph{case sensitive}, must start with a letter, and can
only consist of letters, numbers, and underscores. Variable names can be
as long as you want. 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>