Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!cornell!batcomputer!rpi!pawl16.pawl.rpi.edu!fargo From: fargo@pawl.rpi.edu (Ethan M. Young) Newsgroups: comp.lang.pascal Subject: Re: function returning a record? Message-ID: <790@rpi.edu> Date: 1 Mar 89 06:49:15 GMT References: <2012@pur-phy> Sender: usenet@rpi.edu Organization: Rensselaer Polytechnic Institute, Troy, NY Lines: 21 It's not that Turbo Pascal won't allow you to return a record, it's that your method was slightly off. Try this: FUNCTION Complex_Add(z1,z2 : complex) : comples; VAR temp : complex; { Temporary variable } BEGIN temp.x := z1.x + z2.x; temp.y := z1.y + z2.y; Complex_Add := temp; END; The method you were using wouldn't work as the function returns a record, but is not itself a record. Thus, using the '.' operator on it is invalid. Thank you and happy hunting! Internet: fargo@pawl.rpi.edu ____ [> SB <] fargo@{paraguay|uruguay}.acm.rpi.edu /__ -=>??<=- Bitnet (??): usergac0@rpitsmts.bitnet / ARGO : 3000 years of regression from the year 4990