Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

User Interface to load a String

User Interface to load a String

Hello everybody,

I would like to use an User Interface to load the path of a file in the variables of my program. To give you an idea of what I am looking for, the equivalent function in Matlab would be "uigetfile". Do you know if a such Library exists under OpenModelica?

Thank you by advance for your help!  current/smile

William

Re: User Interface to load a String

For OpenModelica scripting: https://openmodelica.org/doc/OpenModeli … l#loadfile
For OMEdit: no

Re: User Interface to load a String

Hello sjoelund.se,

Thank you for your quick reply. I don't really understand, what is OpenModelica Scripting? Indeed, I do not manage to run the OpenModelica.Scripting.loadFile(...) function in OMedit.

What I do:

class test
import OpenModelica.Scripting.loadFile;
Boolean loadFileErrorFlag;
String pathname = "rabbit.mo";
algorithm
loadFileErrorFlag := loadFile(fileName= pathname);
end test;

What I get:
https://www.openmodelica.org/images/agorapro/attachments/6364/mini_CompilerMessageScreenshot.PNG

Best regards

There are 0 guests and 0 other users also viewing this topic
You are here: