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!news3.google.com!news.glorb.com!newsfeed.kolumbus.fi!nntp.inet.fi!central1.inet.fi!inet.fi!read3.inet.fi.POSTED!53ab2750!not-for-mail Sender: AWI003@FIW9430 Newsgroups: comp.lang.ada Subject: Re: help with string splitting References: <1141863131.984654.144550@j52g2000cwj.googlegroups.com> From: Anders Wirzenius Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 09 Mar 2006 07:43:43 GMT NNTP-Posting-Host: 194.251.142.2 X-Complaints-To: abuse@inet.fi X-Trace: read3.inet.fi 1141890223 194.251.142.2 (Thu, 09 Mar 2006 09:43:43 EET) NNTP-Posting-Date: Thu, 09 Mar 2006 09:43:43 EET Organization: Sonera corp Internet services Xref: g2news1.google.com comp.lang.ada:3302 Date: 2006-03-09T07:43:43+00:00 List-Id: "isaac2004" writes: You could put in some debugging code: ... > Codedtext : Message; --input - string of coded text > Plaintext : Message; --output - plain text message Give some initial values to the strings: Codedtext : Message := ('1','2','3','4','5','6','7',others => ' '); Plaintext : Message := ('1','2','3','4','5','6','7',others => ' '); Then, in the loops, change the relevant position in the input string to 'U' (like "used") and display the strings in the loops, like: > > for I in 2..(Length - 1) loop > > if I REM 2 = 0 then > Plaintext(I + 1) := Codedtext(K); Codedtext (K) := 'U'; > K := K + 1; > else > null; > end if; Ada.Text_IO.Put_Line ("every odd: " & Plaintext (1..Length-1) & "|" & Codedtext (1..Length-1)); and similar code for the "even" loop Good luck! -- Anders