Wrong re-read RM 3.5 (8) An Empty string may be a "Null range" string but zero ( 0 ) is not within the subtype of the Positive type. The second sentence of RM 3.5 ( 8 ) forces the index to be valid for all references including a null range statement. Also, as I pointed out to Adam, about "Ada.Command_line" there may be other sections that may strengthen or may redefine RM 3.5 ( 8 ). A : String ; ... A ( 1..1 ) -- is a valid string with a null range also equal -- to character reference of A ( 1 ) A ( 0..0 ) -- is not valid because the index range is not within -- the valid range of the subtype Postive. -- And at least the compiler should of trap the error. -- Or is this a Compiler Bug! RM 3.5 8 A range is compatible with a scalar subtype if and only if it is either a null range or each bound of the range belongs to the range of the subtype. A range_constraint is compatible with a scalar subtype if and only if its range is compatible with the subtype. And name calling show just how childless you are. In , Jean-Pierre Rosen writes: >anon a �crit : >> For Strings: >> -- 'A' is a zero length string, A'Last = 0, and >> -- put_line ( A ( A'First .. A'Last ) ) ; >> -- does not raise an Constraint_Error even though in >> -- this case it translate to: >> -- put_line ( A ( 0 .. 0 ) ) ; >> A : String := "" ; >> >> Since you can have zero length string , the index is Natual instead of Positive, >> because zero is in Natural but is not define in Positive. Even though the >> Standard package define String index as a Positive type. (GNAT) >> >I usually refrain from responding to "anon", but this is so wrong that I >have to... (Note: in French, "anon" is a young donkey; maybe that's >where he got his name from...) > >The index of String is Positive, full stop. A'Last is 0 because null >ranges are treated specially to avoid spurious Constraint_Error. See 3.5(8) >-- >--------------------------------------------------------- > J-P. Rosen (rosen@adalog.fr) >Visit Adalog's web site at http://www.adalog.fr