comp.lang.ada
 help / color / mirror / Atom feed
From: Anders Wirzenius <anders@no.email.thanks.invalid>
Subject: Re: help with string splitting
Date: Thu, 09 Mar 2006 07:43:43 GMT
Date: 2006-03-09T07:43:43+00:00	[thread overview]
Message-ID: <u4q28qd00.fsf@no.email.thanks.invalid> (raw)
In-Reply-To: 1141863131.984654.144550@j52g2000cwj.googlegroups.com

"isaac2004" <isaac_2004@yahoo.com> 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



  parent reply	other threads:[~2006-03-09  7:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-09  0:12 help with string splitting isaac2004
2006-03-09  0:44 ` jimmaureenrogers
2006-03-09  2:21 ` Jeffrey R. Carter
2006-03-09  5:54   ` isaac2004
2006-03-09 16:50     ` Martin Krischik
2006-03-09 18:31       ` isaac2004
2006-03-09 19:58         ` jimmaureenrogers
2006-03-10 10:45         ` Martin Krischik
2006-03-09 19:28     ` Jeffrey R. Carter
2006-03-09  7:43 ` Anders Wirzenius [this message]
2006-03-09 10:15 ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox