Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!balrog!smith From: smith@ctron.com (Larry Smith) Newsgroups: comp.lang.pascal Subject: Re: passing two variables Message-ID: <1726@balrog.ctron.com> Date: 21 Jun 91 15:19:25 GMT References: <1991Jun21.144356.19598@javelin.sim.es.com> Sender: news@balrog.ctron.com Organization: Cabletron Systems Inc. Rochester, NH Lines: 40 Nntp-Posting-Host: glinda In article <1991Jun21.144356.19598@javelin.sim.es.com> tpehrson@javelin.sim.es.com writes: >i would like a function to pass back two variables. is this possible? >below is an example of what i'd like to accomplish: > >cx,cy :=checkvalid(cx+offset,cy+offset); In a word: no. Some Pascals let you return a record, you could try: TYPE RtnVal = RECORD cx, cy: WHATEVER; END; FUNCTION checkvalid(x,y: WHATEVER) : RtnVal; VAR r: RtnVal; BEGIN r := checkvalid(x,y); END. Of course, some Pascals don't. In which case you will need: FUNCTION checkvalid(x,y: WHATEVER): ^RtnVal; and VAR r: ^RtnVal; Not elegant, but it works. -- Larry Smith smith@ctron.com The usual disclaimer stuff...