Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!tektronix!percival!parsely!agora!ihf1!bobd From: bobd@ihf1.UUCP (Bob Dietrich) Newsgroups: comp.lang.pascal Subject: Re: function returning a record? Message-ID: <553@ihf1.UUCP> Date: 3 Mar 89 20:00:54 GMT References: <2012@pur-phy> <790@rpi.edu> <2016@pur-phy> Reply-To: bobd@ihf1.UUCP (Bob Dietrich) Organization: Intel Corp., Hillsboro, Oregon Lines: 27 In article <2016@pur-phy> murphy@newton.physics.purdue.edu.UUCP (William J. Murphy) writes: > [...] The error message for this problem >correctly points out that you cannot declare a function as returning >anything other than simple types and pointers. > >In light of the conversation in this group a few weeks ago about splitting >the group into PC/Turbo Pascal and others, I wished to get an answer >to this question (above) in the broader scope of knowledge about Pascal. >The only Pascal compiler I use is Turbo Pascal. > >Bill Murphy >murphy@newton.physics.purdue.edu In standard Pascal the statement above is correct: you can only define functions to return simple types (integer, char, real, Boolean, subranges, enumerations) and pointers. To some degree, this was done to keep implementation of the language simple; it was also influenced by the fact for the first implementation of Pascal (CDC 6000 series), all these quantities fit in one 60-bit word. Draft Proposed Extended Pascal relaxes this restriction, and allows anything except files. Thus you can now have functions returning complex (which, BTW, is a simple type!), arrays, records, or sets. usenet: uunet!littlei!intelhf!ihf1!bobd Bob Dietrich or tektronix!ogccse!omepd!ihf1!bobd Intel Corp., Hillsboro, Oregon or tektronix!psu-cs!omepd!ihf1!bobd (503) 696-2092