- Index
- » Programming
- » Modelica Language
- » function call with multiple output
function call with multiple output
function call with multiple output
function add
input Integer a;
input Integer b;
output Integer sum;
output Integer subtract;
output Integer multiply;
algorithm
sum:= a+b;
if (a>b) then
subtract:= a-b;
else
subtract:= b-a;
multiply:= a*b;
end if;
end add;
if i want to get just the multiplication part of the result then i did
(,,mult) := add (3,4);
which works fine but when i want only subtraction part then it doesnt work
(,sub):= add (3.4);
Re: function call with multiple output
I haven't tried it but i think you must specify three outputs,
Code:
(,sub,);=add(3,4);
you are missing the third output.
Adeel.
- adeas
- 454 Posts
Re: function call with multiple output
Create a ticket at https://trac.openmodelica.org/OpenModelica/newticket and someone will fix it. The code is valid and should work.
- sjoelund.se
- 1700 Posts
- Index
- » Programming
- » Modelica Language
- » function call with multiple output