Annotation of loncom/html/adm/help/tex/Numerical_Response_Simple_Example.tex, revision 1.1
1.1 ! bowersj2 1:
! 2: A script consists of several \textbf{statements}, separated by \textbf{semi-colons}.
! 3: A \textbf{statement\index{statement}} is the smallest kind of instruction
! 4: to the computer. Most problems will be built from several statements.
! 5:
! 6: A script can contain \textbf{comments}, which are not interpreted as statements
! 7: by the computer. Comments start with \textbf{\#}, and go to the end of that
! 8: line. Thus, if a line starts with \#, the whole line is ignored. Comments
! 9: can also begin in the middle of a line. It is a good idea to comment more
! 10: complicated scripts, as it can be very difficult to read a large script and
! 11: figure out what it does. It is a \emph{very} good idea to adopt some sort
! 12: of commenting standard, especially if you are working in a group or you believe
! 13: other people may use your problems in the future.
! 14:
! 15: \begin{itemize}
! 16: \item One of the simplest statements in LON-CAPA is a \textbf{variable assignment}.
! 17: A \textbf{variable} can hold any value in it. The variable name must start
! 18: with a \textbf{\$}. In the \textbf{Script}, you need to assign to variables
! 19: before you use them. Put this program into the \textbf{Script} field of the
! 20: Numerical Response:
! 21:
! 22: \begin{lyxcode}
! 23: \$variable~=~3;
! 24: \end{lyxcode}
! 25: This creates a variable named \textbf{variable} and assigns it the value
! 26: of {}``3''. That's one statement.
! 27:
! 28: \end{itemize}
! 29: Variable names are \emph{case sensitive}, must start with a letter, and can
! 30: only consist of letters, numbers, and underscores. Variable names can be
! 31: as long as you want.
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>