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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4dfbb9c23c9a83eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!sn-xit-04!sn-xit-12!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Adaddict" Newsgroups: comp.lang.ada Subject: (Follow-up) Date: Sun, 07 Aug 2005 12:15:32 -0400 Organization: www.talkaboutprogramming.com Message-ID: <4b599f2a499d4157d3904e163be90ad5@localhost.talkaboutprogramming.com> X-Newsreader: www.talkaboutprogramming.com X-Problems-To: info at talkaboutnetwork.com X-Posted-By: USERID-68263 Content-Type: text/plain; References: <27c5ecc06ac6a213466ab65361d20376@localhost.talkaboutprogramming.com> <2db7e95053c018032e212a9f7c2c614d@localhost.talkaboutprogramming.com> X-Complaints-To: abuse@supernews.com Xref: g2news1.google.com comp.lang.ada:4019 Date: 2005-08-07T12:15:32-04:00 List-Id: Thank you for the replies. I'm using Windows XP SP2, GNAT 3.15p and Ada GIDE. The aplication has to work on Win XP. The function that causes this error is called from the main task, but the big variable is local from that function. I'll write a simple version of the function: procedure Search_str (FileAccess : in Handle; Query : in string; Results : out Integer) is mbi : Memory_Basic_Information; lpPos : uinteger; lPos : integer; CalcPos : uinteger; max : uinteger; length : constant integer := Query'last; begin Results := 0; lpPos := Min_Pos; max := Max_Pos; while lpPos < max loop mbi.RegionSize := 0; mbi := Query_Pos (FileAccess, lpPos); if ((mbi.C_Type = PRIVATE_DATA) and (mbi.State = COMMIT_DATA)) then if mbi.RegionSize > 0 then declare sBuffer : string (1..integer(mbi.RegionSize)); begin sBuffer := Read(FileAccess, mbi.BasePos, mbi.RegionSize); lPos := instr (Query, length, sBuffer); if lpos > 0 then CalcAddress := address_to_uinteger(mbi.BaseAddress) + uinteger(lPos); Put_Line ("Search string was found at position" & uInteger'image(CalcPos) & "."); Results := Results+1; end if; end; end if; end if; lpPos := mbi.BasePos + mbi.RegionSize; end loop; end Search_str; Thankyou everyone again. Kind regards.