with ada.Text_IO; use ada.Text_IO; package body B_Str_pkg is procedure put(bw: B_Str) is begin put(bw.chars(1..bw.length)); end put; -- we'll need to compare two bounded strings; we want -- ("cat_xyz..",3) = ("cat_zzz..",3) -- but the built-in/default `=` for records would compare all 37chars. -- function "="(left, right: B_Str) return Boolean is begin return left.chars(1..left.length) = right.chars(1..right.length); end "="; function get_B_Str return B_Str is result: B_Str; begin get_line( result.chars, result.length ); return result; end get_B_Str; function new_B_Str( txt: String ) return B_Str is rslt: B_Str; begin if txt'length > B_Str.chars'length then raise Txt_Too_Long_Buddy; endif; rslt.length := txt'length; rslt.chars(1..txt'length) := txt; return rslt; end new_B_Str; end B_Str_pkg;