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 06:43:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!wn14eed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail From: "Steve Doiel" Newsgroups: comp.lang.ada References: Subject: Re: Out parameters in a function X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: <8OAu8.228200$Yv2.67787@rwcrnsc54> NNTP-Posting-Host: 12.225.227.101 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc54 1018878212 12.225.227.101 (Mon, 15 Apr 2002 13:43:32 GMT) NNTP-Posting-Date: Mon, 15 Apr 2002 13:43:32 GMT Organization: AT&T Broadband Date: Mon, 15 Apr 2002 13:43:32 GMT Xref: archiver1.google.com comp.lang.ada:22547 Date: 2002-04-15T13:43:32+00:00 List-Id: "Nazgul" wrote in message news:a9chqr$23e76$1@ID-107015.news.dfncis.de... > Hi, I need to use an output parameter in an Ada function, something like > > function ReadChar(f: File; c: out character) return boolean; > If you "need" this function because you're used to the C construct while ( (c=getchar()) != EOF ) May I suggest loop ReadChar( file, char, end_of_file ); exit when end_of_file; ... end loop; instead? SteveD > 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 > (:==================:) > >