Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!purdue!mentor.cc.purdue.edu!j.cc.purdue.edu!pur-ee!pur-phy!murphy From: murphy@pur-phy (William J. Murphy) Newsgroups: comp.lang.pascal Subject: function returning a record? Message-ID: <2012@pur-phy> Date: 28 Feb 89 15:13:43 GMT Reply-To: murphy@newton.physics.purdue.edu.UUCP (William J. Murphy) Organization: Purdue Univ. Physics Dept., W. Lafayette, IN Lines: 34 I was trying to program a function yesterday similar to the following: type complex = Record x, y : real; End; function Complex_Add( z1, z2 : complex) : complex; Begin Complex_Add.x := z1.x + z2.x; Complex_Add.y := z1.y + z2.y; End; var z1, z2, z3 : complex; Begin z1.x := 1.0; z1.y := 2.0; z2.x := 0.0; z2.x := 1.5; z3 := Complex_Add( z1, z2); End. I found out that Turbo Pascal 5.0 does not support returning a record as a value. Does this imply that a function can only return a single value? Is there any way to get a function to return a record? Any help would be appreciated. I will in the mean-time write this with pointers. Thanks, Bill Murphy murphy@newton.physics.purdue.edu