Opened 9 years ago
Closed 8 years ago
#4187 closed defect (invalid)
setCommandLineOptions do not stick after an assignment in mos scripts
| Reported by: | Adrian Pop | Owned by: | Adrian Pop |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Interactive Environment | Version: | |
| Keywords: | Cc: |
Description
setCommandLineOptions({"+g=MetaModelica","+d=rml,gen"}); OpenModelica.Scripting.setCFlags("-g " + getCFlags()); getErrorString(); files := { "../../../OMCompiler/Compiler/FrontEnd/Absyn.mo", "../../../OMCompiler/Compiler/Util/Error.mo", "../../../OMCompiler/Compiler/Util/ErrorExt.mo", "../../../OMCompiler/Compiler/Util/Print.mo", "../../../OMCompiler/Compiler/Util/StringUtil.mo", "../../../OMCompiler/Compiler/Util/Flags.mo", "../../../OMCompiler/Compiler/Global/Global.mo", "../../../OMCompiler/Compiler/Util/Config.mo", "../../../OMCompiler/Compiler/Util/Debug.mo", "../../../OMCompiler/Compiler/Util/List.mo", "../../../OMCompiler/Compiler/Util/Settings.mo", "../../../OMCompiler/Compiler/Util/Corba.mo", "../../../OMCompiler/Compiler/Util/File.mo", "../../../OMCompiler/Compiler/Util/Util.mo", "../../../OMCompiler/Compiler/Util/System.mo", "../../../OMCompiler/Compiler/SimCode/SimCodeUtil.mo", "../../../OMCompiler/Compiler/Template/AbsynDumpTpl.mo", "../../../OMCompiler/Compiler/FrontEnd/Dump.mo", "../../../OMCompiler/Compiler/Template/Tpl.mo" }; getErrorString(); // here the flags set by setCommandLineOptions are gone! LoadCompilerSourcesRes:= OpenModelica.Scripting.loadFiles(files);
Change History (3)
comment:1 by , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → accepted |
comment:2 by , 9 years ago
comment:3 by , 8 years ago
| Milestone: | Future |
|---|---|
| Resolution: | → invalid |
| Status: | accepted → closed |
I checked this and there is nothing wrong with the command-line options being set (they are not part of the environment, but are global variables). What happens is you set MetaModelica grammar, which makes files a list<String> instead of String[:], which you cannot pass to loadFiles.
Note:
See TracTickets
for help on using tickets.

Not only that but if you add
setCommandLineOptions({"+g=MetaModelica","+d=rml,gen"});before the loadFiles it will complain that it cannot find it. It seems that assignments in scripts impact the environment in a bad way.