[Info-vax] String handling

David Froble davef at tsoft-inc.com
Sun Feb 16 08:35:35 EST 2014


Simon Clubley wrote:
> 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.
> 

I never saw implicit data conversations until I used Visual Basic. 
Seemed a bit weird to me, being used to having to explicitly do all such 
conversions.  Well, DCL did such, but I never considered DCL a 
programming language.



More information about the Info-vax mailing list