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,c8faa961aaf3fddb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: help with string splitting References: <1141863131.984654.144550@j52g2000cwj.googlegroups.com> In-Reply-To: <1141863131.984654.144550@j52g2000cwj.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4jMPf.4128$6I.3573@newsread3.news.pas.earthlink.net> Date: Thu, 09 Mar 2006 02:21:52 GMT NNTP-Posting-Host: 67.150.74.46 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1141870912 67.150.74.46 (Wed, 08 Mar 2006 18:21:52 PST) NNTP-Posting-Date: Wed, 08 Mar 2006 18:21:52 PST Xref: g2news1.google.com comp.lang.ada:3299 Date: 2006-03-09T02:21:52+00:00 List-Id: isaac2004 wrote: > > Length : Natural := 1; --total size of the encrypted message > J : Integer := 0; --adjusts midpoint for odd and even strings > K : Integer := 2; --counter for the encrypted string What does it mean for Length to be zero, J to be < 0, or K < 1? It seems Length and K should be Positive, and J, Natural. > while not End_Of_File(File => Indata) loop > > Get( > File => Indata, > Item => Codedtext (Length)); > Length := Length + 1; > > end loop; Now Length is the # of characters read + 1. > --Reconfigures the length to account for odd or even string lengths > > if Length REM 2 = 0 then > J := 0; > else > J := 1; > end if; J := Length rem 2; Do you really want to base this on the length of the input string, which is Length - 1? > for I in 1..(Length - 1) loop > > Put(Item => Plaintext (I)); > > end loop; Put (Item => Plaintext (1 .. Length - 1) ); -- Jeff Carter "Brave Sir Robin ran away." Monty Python and the Holy Grail 59