with String_Pack; use String_Pack; function Enumeration_Image (Type_Name : String; Extension : String := "") return String is Width : Integer := Enumeration_Type'Width + Extension'Length + 2; subtype Pic is String (1 .. Width); X : array (Enumeration_Type) of Pic; Buf : String (1 .. X'Length * Width); Pos : Integer := 1; begin for I in Enumeration_Type loop if I = Enumeration_Type'Last then Move (Compress (Enumeration_Type'Image (I) & Extension & ")"), X (I)); else Move (Compress (Enumeration_Type'Image (I) & Extension & ","), X (I)); end if; Buf (Pos .. Pos + Width - 1) := X (I); Pos := Pos + Width; end loop; return Compress ("type " & Type_Name & " is (" & Buf & ";", All_But_One); end Enumeration_Image;