Skip to content

Commit

Permalink
- added function List.hasSeveralElements
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19210 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Feb 20, 2014
1 parent a0184e0 commit 39f3649
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Compiler/Util/List.mo
Expand Up @@ -8506,6 +8506,20 @@ algorithm
end match;
end hasOneElement;

public function hasSeveralElements
"author:waurich
returns true if the list has more than one element, otherwise false"
input list<ElementType> inList;
output Boolean b;
algorithm
b := match(inList)
local ElementType x;
case ({x}) then false;
case ({}) then false;
else then true;
end match;
end hasSeveralElements;

public function lengthListElements
input list<list<Type_a>> inListList;
output Integer outLength;
Expand Down

0 comments on commit 39f3649

Please sign in to comment.