- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Print to command prompt when echo is...
Page Start Prev 1 Next End
Print to command prompt when echo is false
Print to command prompt when echo is false
Dec-05-19 14:07:46
Hi again,
I'm struggling finding a way to selectively print outputs to console while I'm running MOS scripts.
Either I leave echo(true), thus echoing any statement even if terminated by semicolon, or I completely block any output to console.
I tried printf and Modelica.Utilities.Streams.print, but none of them seem to allow writing to command prompt even though the latter does work for outputting to file.
Any idea is greatly appreciated!
- DarioMangoni
- 45 Posts
Re: Print to command prompt when echo is false
Dec-05-19 15:53:03
The script echo.mos:
Code:
echo(false); getErrorString();
print("Some string\n"); getErrorString();
print("Some real:" + String(0.5)+"\n"); getErrorString();
print("Some integer:" + String(5)+"\n"); getErrorString();
The result
Code:
adrpo33@ida-0030 MINGW64 /c/home/adrpo33/dev/OMTesting
$ ~/dev/OpenModelica/build/bin/omc echo.mos
Some string
Some real:0.5
Some integer:5
- adrpo
- 885 Posts
Re: Print to command prompt when echo is false
Dec-06-19 08:53:48
Many thanks!
Really valuable information!
- DarioMangoni
- 45 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Print to command prompt when echo is...
There are 0 guests and 0 other users also viewing this topic