Re: Easy question about Character manipulation
- From: Robert A Duff <bobduff@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 30 Jan 2007 15:24:45 -0500
"Jeffrey R. Carter" <jrcarter@xxxxxxx> writes:
Martin Krischik wrote:
It has been suggested before so let me emphasis: use
size: Integer := 10;
Let me emphasize:
Size : constant := 10;
There's no reason for Size to be an object, much less a variable.
I agree that it should probably be constant, but why not give it a type,
as in:
Size : constant Integer := 10;
I think named numbers are a kludge, and should usually be avoided.
And then we have:
emptySpaces : array (1..size) of Character := "0123456789";
textLine : array (1..size * 3) of Character;
If Size is a named number, the index type of these arrays defaults to
Integer -- another language kludge.
Of course, the original poster wanted plain old "String", so all this is
irrelevant to that question.
- Bob
.
- Follow-Ups:
- Re: Easy question about Character manipulation
- From: Jeffrey R. Carter
- Re: Easy question about Character manipulation
- From: Dmitry A. Kazakov
- Re: Easy question about Character manipulation
- References:
- Easy question about Character manipulation
- From: mark
- Re: Easy question about Character manipulation
- From: Martin Krischik
- Re: Easy question about Character manipulation
- From: Jeffrey R. Carter
- Easy question about Character manipulation
- Prev by Date: Re: Reading Float Data from a binary file into ada
- Next by Date: Re: Ravenscar - program termination
- Previous by thread: Re: Easy question about Character manipulation
- Next by thread: Re: Easy question about Character manipulation
- Index(es):