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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81fdb4c9989055c6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "jimmaureenrogers@worldnet.att.net" Newsgroups: comp.lang.ada Subject: Re: Status_Error in close() of file Date: 7 Dec 2005 05:50:09 -0800 Organization: http://groups.google.com Message-ID: <1133963409.624983.214090@g14g2000cwa.googlegroups.com> References: <1133962026.359542.133690@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: 69.170.70.49 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1133963414 18544 127.0.0.1 (7 Dec 2005 13:50:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 7 Dec 2005 13:50:14 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=69.170.70.49; posting-account=SqOfxAwAAAAkL81YAPGH1JdBwpUXw9ZG Xref: g2news1.google.com comp.lang.ada:6762 Date: 2005-12-07T05:50:09-08:00 List-Id: rashmi wrote: > Dear reader > > When using the function FUNC_OpClFile() below I have been getting a > Status_Error after all my data was read from the file "OJV.dat" . Using > the debugger I located this error at the place where "OJV.dat" was > asked to be closed by the close() function. As I suspected that the > problem was because the close() function could not locate the > End-of-File marker, I even wrote another function FUNC_CanCloFi to seek > and return the End-of-File marker where found, so that close() could > work. But the same Status_Error message still persists. So I am trying > to figure out where and why the problem is exactly happening. > > Rashmi. > > ******************************************************************************* > function FUNC_OpClFile(EN_Cald : in EN_FnCd) return EN_Acpt is > type RE_FilRcd is > record > PV_FilIMo : File_Mode := In_File ; > PV_FilIty : File_Type; > end record; > TF_CanClo : Boolean; > RE_RcdFil : RE_FilRcd; > EN_OCFRtn : EN_Acpt := EN_IsOk; > ST_IFiNam : String := ".\OJV.dat"; > begin > case EN_Cald is > when EN_NtCd => > open > (RE_RcdFil.PV_FilIty,RE_RcdFil.PV_FilIMo,ST_IFiNam); > set_input(RE_RcdFil.PV_FilIty); > when EN_IsCd => > TF_CanClo := FUNC_CanCloFi; > if TF_CanClo then > close(RE_RcdFil.PV_FilIty); > end if; > when others => > Null; > end case; > return EN_OCFRtn; > end FUNC_OpClFile; > How is RE_RcdFil.PV_Fillty set when FUNC_OpClFile is called with a value of EN_IsCd? You apparently believe that it retains its value from the open call. That cannot be true. Your close procedure will work properly when you pass in a file_type variable with a valid value. Jim Rogers