Dear Federico, enumerations are not implemented yet in OpenModelica, and was not until very recently not implemented in any commercial Modelica environment.
It is in the TODO list. /Peter F -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Federico Zenith Sent: den 4 augusti 2008 08:00 To: [email protected] Subject: Enumeration issues Hi everybody, I am having problems with a function using an enumeration as an argument. Here it goes: ----------------------------- type C = enumeration( one, two, three ); function Test input C c; output Integer n; algorithm if c == C.one then n := 1; elseif c == C.two then n := 2; else n := 3; end if; end Test; #-- Cannot convert empty prefix to component reference #-- Cannot convert empty prefix to component reference #-- Cannot convert empty prefix to component reference #-- Cannot convert empty prefix to component reference - Ceval.cevalCrefBinding failed (UNBOUND) Error occured building AST Syntax Error ----------------------------- I can't really figure out what is wrong. Does anyone see it? Furthermore, if I run "String(C.one)", I do not get a string "one", as should be the behaviour according to specification. Is this a missing feature, or am I looking in the wrong place? Cheers, -Federico
