Skip to content

Commit

Permalink
Clean up some whitespace in some code listings in chapter 'Statements'
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Jul 14, 2020
1 parent b1e3aee commit cc69a0d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions chapters/statements.tex
Expand Up @@ -143,7 +143,7 @@ \subsubsection{Assignments from Called Functions with Multiple Results}\doublela
The function \lstinline!f! called below has three results and two inputs:
\begin{lstlisting}[language=modelica]
(a, b, c) := f(1.0, 2.0);
(x[1], x[2], x[1]) := f(3,4);
(x[1], x[2], x[1]) := f(3, 4);
\end{lstlisting}
In the second example above \lstinline!x[1]! is assigned twice: first with the first output, and then with the third output. For that case the following will give the same result:
\begin{lstlisting}[language=modelica]
Expand Down Expand Up @@ -248,11 +248,11 @@ \subsubsection{Implicit Iteration Ranges}\doublelabel{implicit-iteration-ranges}
\end{lstlisting}

\begin{lstlisting}[language=modelica]
type FourEnums=enumeration(one,two,three,four);
Real xe[FourEnums]= x;
Real xsquared3[FourEnums]={xe[i]*xe[i] for i};
Real xsquared4[FourEnums]={xe[i]*xe[i] for i in FourEnums};
Real xsquared5[FourEnums]={x[i]*x[i] for i};
type FourEnums = enumeration(one, two, three, four);
Real xe[FourEnums] = x;
Real xsquared3[FourEnums] = {xe[i] * xe[i] for i};
Real xsquared4[FourEnums] = {xe[i] * xe[i] for i in FourEnums};
Real xsquared5[FourEnums] = {x[i] * x[i] for i};
\end{lstlisting}
\end{example}

Expand Down Expand Up @@ -340,12 +340,12 @@ \subsection{Break-Statement}\doublelabel{break-statement}
input Integer val;
output Integer index;
algorithm
index := size(x,1);
index := size(x, 1);
while index >= 1 loop
if x[index]== val then
if x[index] == val then
break;
else
index := index -- 1;
else
index := index - 1;
end if;
end while;
end findValue;
Expand Down

0 comments on commit cc69a0d

Please sign in to comment.