From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,9245b8db9abd376c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-15 03:49:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!news.demon.co.uk!demon!pipehawk.demon.co.uk!not-for-mail From: john.mccabe@emrad.ns.com (John McCabe) Newsgroups: comp.lang.ada Subject: Re: Out parameters in a function Date: Mon, 15 Apr 2002 10:49:04 GMT Organization: Emrad Ltd Message-ID: <3cbaafd0.10365294@news.demon.co.uk> References: NNTP-Posting-Host: pipehawk.demon.co.uk X-NNTP-Posting-Host: pipehawk.demon.co.uk:158.152.226.81 X-Trace: news.demon.co.uk 1018867685 nnrp-13:15097 NO-IDENT pipehawk.demon.co.uk:158.152.226.81 X-Complaints-To: abuse@demon.net X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:22544 Date: 2002-04-15T10:49:04+00:00 List-Id: On Sun, 14 Apr 2002 20:29:10 +0200, "Nazgul" wrote: You could use a procedure, or you could use a function that returns a record containing a boolean and the character you want. As far as I can remember, a way of getting round the no-side-effects feature of functions is to pass it a pointer then update the contents of the pointed to location. >Hi, I need to use an output parameter in an Ada function, something like > >function ReadChar(f: File; c: out character) return boolean; > >The function must return a boolean, so the only way to read the character is >via the 'c' parameter. In other context, I use > >function (something: tpSomething) return ...; where tpSomething is an access >to a record type, and I can modify the contents of the record in the >function, but if I use > >function ReadChar(f: File; c: access character) return boolean; > >the compiler gives an error when i do something like > >c:=anything; > >Is there any way of using c as an output parameter? > >Thanks. > >-- > > (:==================:) > �lvaro Iradier > airadier@able.es > (+34)660133259 > (:==================:) > >