In Modelica, is it possible to have an if-condition and a command in one line?
(Of course it is possible to write it in three lines, but I would prefer it in one line.)
Something like:
Boolean verbose;
...
if verbose then Modelica.Utilities.Streams.print("iteration steps " + String(iter), "printlog.txt");
What is wrong with the code you wrote? Only thing I find missing is the end if.
if cond then print(str, file); end if;