Re: Easy question about Character manipulation



Robert A Duff wrote:

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.

I think they should be used whenever possible.

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.

Right. All such ranges should be a discrete subtype, either by name or by being the part to the right of "is" in a subtype declaration: Integer range X .. Y;

And there should be no anonymous types.

--
Jeff Carter
"Alms for an ex-leper!"
Monty Python's Life of Brian
75
.