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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81fdb4c9989055c6,start 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: "rashmi" Newsgroups: comp.lang.ada Subject: Status_Error in close() of file Date: 7 Dec 2005 05:27:06 -0800 Organization: http://groups.google.com Message-ID: <1133962026.359542.133690@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: 61.11.60.236 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1133962031 16624 127.0.0.1 (7 Dec 2005 13:27:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 7 Dec 2005 13:27:11 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=61.11.60.236; posting-account=3DKkFw0AAACqdEmipLjcQnXXVUyr7_Eb Xref: g2news1.google.com comp.lang.ada:6761 Date: 2005-12-07T05:27:06-08:00 List-Id: 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; function FUNC_CanCloFi return Boolean is TF_NxtEof : Boolean := False; CH_Dumy : Character; begin while not TF_NxtEof loop if not End_of_File then Get_Immediate(CH_Dumy); end if; if End_of_File then TF_NxtEof := True; end if; end loop; return TF_NxtEof ; end FUNC_CanCloFi; ******************************************************************************* OJV.dat 8 1 8 2 0 3 0 4 0 1 4 1 2 5 1 3 3 1 4 2 1 5 6 1 6 5 1 7 3 1 8 3 1 1 -1.5 +9.0 2 -1.0 +5.4 3 +2.3 +3.0 4 +1.1 +2.1 5 +1.2 +1.4 6 +2.4 +2.9 7 -2.1 +8.7 8 -2.3 +5.6