Re: help with string splitting
- From: Martin Krischik <krischik@xxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 09 Mar 2006 17:50:53 +0100
isaac2004 wrote:
First_Half_Index : Positive := 1;
Second_Half_Index : Positive := 2;
for Code_Index in Codetext'Length loop> if Code_Index <= Codetext'Length / 2 then
> Plaintext(First_Half_index) := Codetext(Code_Index);
First_Half_Index := First_Half_Index + 2;
else
Plaintext(Second_Half_Index) := Codetext(Code_Index);
Second_Half_Index := Second_Half_Index + 2;
end if;
end loop;
this code confuses me
what is Code_Index and Codetext'Length
Code_Index is a variable declared as part of for loop. C99 can do that as
well - finally ;-) . See:
http://en.wikibooks.org/wiki/Ada_Programming/Control#for_loop
Codetext'Length is the length of the array - mind you I would have used
Codetext'Range - which is range of valid indices for Codetext. See:
http://en.wikibooks.org/wiki/Ada_Programming/Attributes/'Length
http://en.wikibooks.org/wiki/Ada_Programming/Attributes/'Range
Martin
--
mailto://krischik@xxxxxxxxxxxxxxxxxxxxx
Ada programming at: http://ada.krischik.com
.
- Follow-Ups:
- Re: help with string splitting
- From: isaac2004
- Re: help with string splitting
- References:
- help with string splitting
- From: isaac2004
- Re: help with string splitting
- From: Jeffrey R. Carter
- Re: help with string splitting
- From: isaac2004
- help with string splitting
- Prev by Date: Re: gnatmake myProg.adb -largs -Wl,-stack_size -Wl,0x4000000
- Next by Date: Re: help with string splitting
- Previous by thread: Re: help with string splitting
- Next by thread: Re: help with string splitting
- Index(es):
Relevant Pages
|
|