[Info-vax] String handling, was: Re: C... the only winning move is not to play...

David Froble davef at tsoft-inc.com
Sat Feb 15 16:15:58 EST 2014


Simon Clubley wrote:
> On 2014-02-15, VAXman-  @SendSpamHere.ORG <VAXman- at SendSpamHere.ORG> wrote:
>> In article <ldnnn6$ji6$1 at dont-email.me>, Simon Clubley <clubley at remove_me.eisner.decus.org-Earth.UFP> writes:
>>> For comparison, Ada has a half-way datatype, between fixed length and
>>> fully dynamic strings, called Bounded_String in which space up to a
>>> maximum length is pre-allocated but it's otherwise treated as a
>>> dynamic string.
>> That's a fixed length string in my view.  Think VMS string descriptor here.
>> The storage is allocated to the amount bounded and that memory is made the
>> pointer in the descriptor.  The only thing then that changes is the length.
>>
> 
> Is VMS Basic's fixed length string really the same as a Bounded_String
> (with a dynamic length component) ?
> 
> I'm more used to something described as a fixed length string really
> being a immutable length (think Ada's String data type as a example here).
> 
> For example, I don't mentally think of "unsigned char buffer[80];" as
> being a fixed length string. I think of it as more like a Bounded_String
> but with a length indicated by a special character (0x00) instead of
> a explicit length.
> 
> Simon.
> 

Basic uses standard VMS data types.  Nothing strange there.

Fixed length string is basically a string descriptor with a pointer to 
the string and the length.  The pointer and length never changes.  If 
you assign it a value smaller than the length, it has trailing spaces.



More information about the Info-vax mailing list