- Index
- » Programming
- » Modelica Language
- » optional input for 'record'
Page Start Prev 1 Next End
optional input for 'record'
optional input for 'record'
Jun-21-17 17:35:53
Hey all,
So I am implementing a caching mechanism. Modelica does not have global variable so I need to pass this cache around. However, I want this cache input to be optional in a function, like
function tempFunc
input Cache cache = NULL;
end tempFunc;
But Modelica does not have NULL. Any suggestion? Thank you!
Re: optional input for 'record'
Jun-21-17 18:09:21
Can you use external objects for this?
- lochel
- 45 Posts
Re: optional input for 'record'
Jul-14-17 12:36:54
Actually, ExternalObject does not help. For example, in the following code, I want to call test(5) with no input for 'obj' but what should be the default value for the 'obj'?
Code:
function test
input Integer N;
input ExtObj obj = ???;
algorithm
end test;
class TestModel
algorithm
test(5)
end TestModel;
Edited by: cvan - Jul-14-17 12:37:34
Page Start Prev 1 Next End
- Index
- » Programming
- » Modelica Language
- » optional input for 'record'
There are 0 guests and 0 other users also viewing this topic