[Info-vax] String handling

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Sun Feb 16 04:54:47 EST 2014


On 2014-02-15, Paul Sture <nospam at sture.ch> wrote:
> On 2014-02-15, Simon Clubley <clubley at remove_me.eisner.decus.org-Earth.UFP> wrote:
>>
>> Thanks, Hoff; I've never used DEC/CPQ/HP BASIC.
>>
>> That fits with my definition of a fixed length string and the closest in
>> Ada would be a variable of the String data type, which, once created, has
>> a immutable length.
>>
>> However, unless you call the appropriate function, you need to handle
>> the padding/truncation yourself. This is in keeping with Ada's safety
>> orientated mindset.
>
> Every language that I did in early days (RPG, DIBOL, COBOL etc) had clearly
> defined behaviour here.   The documentation and any training materials
> would contain examples which covered both space filling and truncation such
> as can be seen here for HP COBOL:
>
><http://h71000.www7.hp.com/doc/82final/6297/6297pro_025.html#alpha_just_move_sec>
>
> The 's' in those table entries stands for 'space'
>

Thanks Paul.

The safety aspect here is not undefined behaviour within the language
but with language constructs which can lose or alter data without that
potential loss/alteration of data being marked clearly within the
application source code.

That's why Ada has very few implicit type conversions allowed compared
to some other languages. You can still do the type conversion in many
cases; it's just that you have to do it in a way which draws attention
to it within the source code.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world



More information about the Info-vax mailing list