Skip to content

Commit

Permalink
Break oversize listing lines in record constructor examples
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Dec 16, 2021
1 parent c2b0a82 commit fb23c08
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions chapters/functions.tex
Expand Up @@ -1079,7 +1079,9 @@ \section{Record Constructor Functions}\label{record-constructor-functions}
input Real r5 = 5.0;
input Real r6[n1];
input Real r7[n2];
output Record2 $\mathit{result}$(r0=r0,c2=c2,n1=n1,n2=n2,r1=r1,r2=r2,r4=r4,r5=r5,r6=r6,r7=r7);
output Record2 $\mathit{result}$(
r0 = r0, c2 = c2, n1 = n1, n2 = n2,
r1 = r1, r2 = r2, r4 = r4, r5 = r5, r6 = r6, r7 = r7);
protected
final constant Real c1 = 2.0; // referenced from r2
final parameter Real r3 = Modelica.Math.cos(r2);
Expand All @@ -1089,9 +1091,13 @@ \section{Record Constructor Functions}\label{record-constructor-functions}
and can be applied in the following way
% henrikt-ma: TODO: Fix too long lines.
\begin{lstlisting}[language=modelica]
Demo.Record2 r1 = Demo.Record2(r0=1, c2=2, n1=2, n2=3, r1=1, r2=2,r4=5, r5=5, r6={1,2}, r7={1,2,3});
Demo.Record2 r2 = Demo.Record2(1,2,2,3,1,2,5,5,{1,2},{1,2,3});
parameter Demo.Record2 r3 = Demo.Record2(c2=2, n2=1, r1=1,r4=4, r6=1:5, r7={1});
Demo.Record2 r1 =
Demo.Record2(r0 = 1, c2 = 2, n1 = 2, n2 = 3, r1 = 1, r2 = 2, r4 = 5, r5 = 5,
r6 = {1, 2}, r7 = {1, 2, 3});
Demo.Record2 r2 =
Demo.Record2(1, 2, 2, 3, 1, 2, 5, 5, {1, 2}, {1, 2, 3});
parameter Demo.Record2 r3 =
Demo.Record2(c2 = 2, n2 = 1, r1 = 1, r4 = 4, r6 = 1 : 5, r7 = {1});
\end{lstlisting}

The above example is only used to show the different variants
Expand Down

0 comments on commit fb23c08

Please sign in to comment.