Re: Easy question about Character manipulation



"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
.