[Info-vax] String handling

Paul Sture nospam at sture.ch
Sat Feb 15 18:04:37 EST 2014


On 2014-02-15, Simon Clubley <clubley at remove_me.eisner.decus.org-Earth.UFP> wrote:
> On 2014-02-15, Stephen Hoffman <seaohveh at hoffmanlabs.invalid> wrote:
>> On 2014-02-15 16:51:21 +0000, Simon Clubley said:
>>
>>> I was asking about VMS Basic (ie: DEC/CPQ/HP Basic) not about how VMS
>>> implements string handling.
>>>
>>> IOW, when David talked about fixed strings in VMS Basic, did he really
>>> mean fixed strings in the sense of Ada's String data type in which the
>>> length is immutable, or did he really mean something closer to Ada's
>>> Bounded_String data type ?
>>
>> The DEC BASIC fixed-length strings use scaler-class string descriptors,
>> and the string contents are exact-fit / force-fit.  The text strings
>> are truncated or are space-padded to fit, as required.
>>
>
> 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'

--
Paul Sture



More information about the Info-vax mailing list