Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!haven!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!enea!kth!draken!d87-jse From: d87-jse@nada.kth.se (Joakim Sernbrant) Newsgroups: comp.lang.pascal Subject: Re: Enumerated types in TP40 Keywords: none Message-ID: <731@draken.nada.kth.se> Date: 10 Jan 89 20:10:10 GMT References: <363@lafcol.UUCP> Reply-To: d87-jse@nada.kth.se (Joakim Sernbrant) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 16 In article <363@lafcol.UUCP> pilgrimk@lafcol.UUCP (Guru Jee) writes: >How can the number of elements in an enumerated type be determined? > > e.g. type > Enum1 = (One, Two, Three, Four); > Enum2 = (_One, _Two, _Three); > >I would like to get a value of 4 for the no. of elements in any >variable declared as "Enum1" and 3 for those declared as "Enum2". Is >this possible? I believe something like sizeof(Enum1) div sizeof(Enum1(ord(One))) will do the trick, but I'm unable to test this right now... -- -- Joakim Sernbrant, Royal Institute of Technology, Stockholm, Sweden -- Internet: d87-jse@nada.kth.se --