STRING length
Hi,
How does one use a variable length string in ada? I created a record
like:
type MY_RECORD is
record
m_strName : STRING(1..5);
m_strPhone : STRING(1..5);
m_strAddress : STRING(1..5);
end record;
However when trying to assign the members of the record, at runtime I
may get an exception if the assigned string is not exactly 5
characters. Is there a different STRING type which doesn't care how
long the assigned string is (as long as it's shorter than the max) or
which just grows to meet the assigned string length?
Thanks
.
Relevant Pages
- Re: STRING length
... markww wrote: ... How does one use a variable length string in ada? ... may get an exception if the assigned string is not exactly 5 ... (comp.lang.ada) - Re: The future of Ada is at risk
... working under Mac OS X. ... People should have the opportunity to "give Ada a spin" free of charge, ... I don't see how simple but powerful string handling ... I think that the default string type should be the unbounded string, ... (comp.lang.ada) - Re: How come Ada isnt more popular?
... Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm ... Perhaps if the central string were a number? ... But when I compare a book on expert systems written in C and one written in Ada (well, Ada83), the book in Ada is both thicker and has more pages devoted to code than the book in C, and the expert systems are approximately of equivalent power. ... (comp.lang.ada) - Re: Teaching new tricks to an old dog (C++ -->Ada)
... In Ada I could use Ada.Strings.Bounded_Strings ... not at all convinced that two separate string classes are necessary to ... allocator that only ever allocates a block of the initially-specified ... And thead save means that an exception may be ... (comp.lang.ada) - Re: Interpretation of extensions different from Unix/Linux?
... the use of UTF-8 in this way is the recommendation of the ARG. ... (UTF-8 is a problem of its own in Ada. ... a UTF-8 encoded string is a String. ... You can't enumerate roots in Windows, ... (comp.lang.ada) |
|