Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Ignorance is bliss. -- Thomas Gray Fortune updates the great quotes, #42: BLISS is ignorance.


computers / comp.os.vms / VMS Basic strings class D vs class S

SubjectAuthor
* VMS Basic strings class D vs class SArne Vajhøj
+* Re: VMS Basic strings class D vs class SDave Froble
|`- Re: VMS Basic strings class D vs class SArne Vajhøj
+* Re: VMS Basic strings class D vs class SLawrence D'Oliveiro
|`- Re: VMS Basic strings class D vs class SArne Vajhøj
`* Re: VMS Basic strings class D vs class SStephen Hoffman
 `* Re: VMS Basic strings class D vs class SArne Vajhøj
  +* Re: VMS Basic strings class D vs class SScott Dorsey
  |`- Re: VMS Basic strings class D vs class SArne Vajhøj
  `* Re: VMS Basic strings class D vs class SStephen Hoffman
   `- Re: VMS Basic strings class D vs class SLawrence D'Oliveiro

1
VMS Basic strings class D vs class S

<urgbne$22p1o$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33586&group=comp.os.vms#33586

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: VMS Basic strings class D vs class S
Date: Sun, 25 Feb 2024 16:33:33 -0500
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <urgbne$22p1o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 25 Feb 2024 21:33:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3c4a04b6d33d9b58db0c804784753107";
logging-data="2188344"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8PT7A+Bvr5FB0qDPPBj/q4Wzkk9CNhHM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:oD8zseIJ6P2C9kvjm4w1G4nKOjU=
Content-Language: en-US
 by: Arne Vajhøj - Sun, 25 Feb 2024 21:33 UTC

If I have understood it correctly then VMS Basic
strings use class D descriptors.

That is very nice.

But what happens if non-Basic code call Basic
code with a string using a class S descriptor?
For input/read? For output/write?

Does the Basic runtime call some STR$ function that
understands the difference between S and D and handle
A properly? Or will I get a runtime error due to invalid
string?

Arne

Re: VMS Basic strings class D vs class S

<urgk24$2595r$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33587&group=comp.os.vms#33587

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: davef@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Sun, 25 Feb 2024 18:55:25 -0500
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <urgk24$2595r$1@dont-email.me>
References: <urgbne$22p1o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 25 Feb 2024 23:55:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9879aa00da7b49f1d86a2771399c2211";
logging-data="2270395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yphjHTSVKld1EBObgxnLhWzZwssm0xzo="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:8lD5xEWuFVvfFIq2d8g6UB9YPyc=
In-Reply-To: <urgbne$22p1o$1@dont-email.me>
 by: Dave Froble - Sun, 25 Feb 2024 23:55 UTC

On 2/25/2024 4:33 PM, Arne Vajhøj wrote:
> If I have understood it correctly then VMS Basic
> strings use class D descriptors.
>
> That is very nice.
>
> But what happens if non-Basic code call Basic
> code with a string using a class S descriptor?
> For input/read? For output/write?
>
> Does the Basic runtime call some STR$ function that
> understands the difference between S and D and handle
> A properly? Or will I get a runtime error due to invalid
> string?
>
> Arne

I don't know the correct answer, but, at a guess, whatever is called to handle
the string quite likely will evaluate the descriptor and do "the right thing".
That would be my bet. Otherwise, why have descriptors?

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: VMS Basic strings class D vs class S

<urgkmj$259hh$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33588&group=comp.os.vms#33588

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Sun, 25 Feb 2024 19:06:42 -0500
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <urgkmj$259hh$1@dont-email.me>
References: <urgbne$22p1o$1@dont-email.me> <urgk24$2595r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 26 Feb 2024 00:06:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="74c489823259b6d7417614efeb2483d2";
logging-data="2270769"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18HPcEwBdGMHoZ3vTOPn69X+ao4nDjrsdE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:pdH5HUlpPUigKZMKtd/eqDkLGx8=
In-Reply-To: <urgk24$2595r$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Mon, 26 Feb 2024 00:06 UTC

On 2/25/2024 6:55 PM, Dave Froble wrote:
> On 2/25/2024 4:33 PM, Arne Vajhøj wrote:
>> If I have understood it correctly then VMS Basic
>> strings use class D descriptors.
>>
>> That is very nice.
>>
>> But what happens if non-Basic code call Basic
>> code with a string using a class S descriptor?
>> For input/read? For output/write?
>>
>> Does the Basic runtime call some STR$ function that
>> understands the difference between S and D and handle
>> A properly? Or will I get a runtime error due to invalid
>> string?
>
> I don't know the correct answer, but, at a guess, whatever is called to
> handle the string quite likely will evaluate the descriptor and do "the
> right thing". That would be my bet.  Otherwise, why have descriptors?

I am pretty sure that Basic will not corrupt anything, but handling it
and causing an exception would both be sort of acceptable behavior.

A trivial example works:

$ type f.for
program f
character*80 s
call b1('ABC')
call b2(s)
write(*,*) '|'//trim(s)//'|'
end
$ type b.bas
sub b1(string s)
print "|" + s + "|"
end sub
! sub b2(string s)
s = "ABC"
end sub
$ for f
$ bas b
$ link f + b
$ run f
|ABC|
|ABC|

But I can't but wonder if it always works.

Arne

Re: VMS Basic strings class D vs class S

<urh13l$2ba6j$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33595&group=comp.os.vms#33595

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Mon, 26 Feb 2024 03:38:29 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <urh13l$2ba6j$1@dont-email.me>
References: <urgbne$22p1o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 26 Feb 2024 03:38:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ea15bd06c2061660f1136ed37eb9a688";
logging-data="2468051"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198C3ZiLTmQY2wOLl4SkWW6"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:9uvx2svdcEXa+ZFXTWsrTYemPTk=
 by: Lawrence D'Oliv - Mon, 26 Feb 2024 03:38 UTC

On Sun, 25 Feb 2024 16:33:33 -0500, Arne Vajhøj wrote:

> If I have understood it correctly then VMS Basic strings use class D
> descriptors.

The “VAX BASIC User Manual” mentions both dynamic and fixed-length
strings. Chapter 13 explains that strings are fixed-length when part of
COMMON, MAP or RECORD statements, otherwise they are dynamic. Fixed-length
strings obviously cannot have their storage reallocated.

In chapter 21, it mentions that, if you pass strings by descriptor from a
language that doesn’t understand dynamic strings (e.g. Fortran), then they
are passed as fixed-length strings.

Re: VMS Basic strings class D vs class S

<uriv4c$2oiol$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33605&group=comp.os.vms#33605

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: seaohveh@hoffmanlabs.invalid (Stephen Hoffman)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Mon, 26 Feb 2024 16:17:00 -0500
Organization: HoffmanLabs LLC
Lines: 58
Message-ID: <uriv4c$2oiol$1@dont-email.me>
References: <urgbne$22p1o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="3a91f935bdceb4e9d6cf39559205903e";
logging-data="2902805"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18W/dXlJDGRba9zZDuL1MpGvgcPCsevkDI="
User-Agent: Unison/2.2
Cancel-Lock: sha1:p4lF6iri7w7rsmi83aTpcPM1t+U=
 by: Stephen Hoffman - Mon, 26 Feb 2024 21:17 UTC

On 2024-02-25 21:33:33 +0000, Arne Vajhøj said:

> If I have understood it correctly then VMS Basic strings use class D
> descriptors.
>
> That is very nice.
>
> But what happens if non-Basic code call Basic code with a string using
> a class S descriptor? For input/read? For output/write?
>
> Does the Basic runtime call some STR$ function that understands the
> difference between S and D and handle A properly? Or will I get a
> runtime error due to invalid string?

"It depends."

Most everything in most of the traditional languages and in the RTLs
does the right thing with both dynamic and static text strings, though
the app code involved might not. BASIC app code works pretty well here,
absent "heroic" efforts by the app developer.

If the app code assumes a dynamic arriving and gets handed static, the
RTL will either copy it, or space-pad the results into the static, or
the RTL will return a string truncation error. BASIC space-pads into
static string buffers if and as needed. Or truncates with an error.

Apps written in C, C++, BLISS, MACRO32, and probably some others may or
may not do the right thing with descriptors, as these languages can
need to handle descriptors in app code due to the (~lack of) descriptor
support in those languages. (Yes, I well know about dscdef.h,
descrip.h, et al., thanks.) Some devs will use RTL calls, and some use
explicit code.

As for home-grown descriptor code, few apps (nobody?) implements all of
the different sorts of descriptors available. Not outside of the RTL
itself, that is.

Apps expecting to work with dynamic descriptors might fail with the
truncation error as mentioned, and apps expecting to massage static
descriptors directly and not coded sufficiently cautiously around any
arriving dynamic strings can fail with heap and other errors.

Of the common languages, Pascal utilizes a wide variety of descriptors.
Calling into or getting called from Pascal tends to teach much about
descriptors and descriptor usage.

it wouldn't surprise me to learn that BASIC will fail to work correctly
with 64-bit string descriptors, though. Lots of home-grown app code
also won't. I also wouldn't expect the RTLs to work with encodings
other than ASCII and DEC MCS, either. And UTF-8 will fail in the
expected places, and most searching and sorting tends not to be
sensitive to the (written) language used within the text string.

--
Pure Personal Opinion | HoffmanLabs LLC

Re: VMS Basic strings class D vs class S

<urnfce$3trjf$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33627&group=comp.os.vms#33627

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Wed, 28 Feb 2024 09:18:54 -0500
Organization: A noiseless patient Spider
Lines: 131
Message-ID: <urnfce$3trjf$1@dont-email.me>
References: <urgbne$22p1o$1@dont-email.me> <urh13l$2ba6j$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Feb 2024 14:18:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3a6403d1a4c4c2051fbb57ee89a4bfc0";
logging-data="4124271"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qp4Cp1goT/COBqMgI2a8lTQ59cQYnvXQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:5Yje7PSsvTcr+OVIQ3qToQ5WTbA=
Content-Language: en-US
In-Reply-To: <urh13l$2ba6j$1@dont-email.me>
 by: Arne Vajhøj - Wed, 28 Feb 2024 14:18 UTC

On 2/25/2024 10:38 PM, Lawrence D'Oliveiro wrote:
> On Sun, 25 Feb 2024 16:33:33 -0500, Arne Vajhøj wrote:
>> If I have understood it correctly then VMS Basic strings use class D
>> descriptors.
>
> The “VAX BASIC User Manual” mentions both dynamic and fixed-length
> strings. Chapter 13 explains that strings are fixed-length when part of
> COMMON, MAP or RECORD statements, otherwise they are dynamic. Fixed-length
> strings obviously cannot have their storage reallocated.

And I guess that sort of makes Basic need to handle it
transparently.

$ type f.for
program f
character*80 s
call print_class('ABC')
call b1('ABC')
call print_class(s)
call b2(s)
write(*,*) '|'//trim(s)//'|'
end
$ type b.bas
sub b1(string s)
print "|" + s + "|"
end sub
! sub b2(string s)
s = "ABC"
end sub
$ type x.c
#include <stdio.h>

#include <descrip.h>

void print_class(struct dsc$descriptor *s)
{ switch(s->dsc$b_class) {
case DSC$K_CLASS_S:
printf("Class S\n");
break;
case DSC$K_CLASS_VS:
printf("Class VS\n");
break;
case DSC$K_CLASS_D:
printf("Class D\n");
break;
default:
printf("Unknown class\n");
break;
}
} $ for f
$ bas b
$ link f + b + x
$ run f
Class S
|ABC|
Class S
|ABC|

has to work, because of:

$ type f.bas
program f
map (blk1) string s1 = 3
map (blk2) string s2 = 80
external sub b1(string)
external sub b2(string)
external sub print_class(string)
external string function trim(string)
s1 = "ABC"
call print_class(s1)
call b1(s1)
call print_class(s2)
call b2(s2)
print "|" + trim(s2) + "|"
end
! function string trim(string s)
declare integer ix
ix = len(s)
while ix > 1 and mid$(s, ix, 1) = " "
ix = ix - 1
next
trim = mid$(s, 1, ix)
end function
$ type b.bas
sub b1(string s)
print "|" + s + "|"
end sub
! sub b2(string s)
s = "ABC"
end sub
$ type x.c
#include <stdio.h>

#include <descrip.h>

void print_class(struct dsc$descriptor *s)
{ switch(s->dsc$b_class) {
case DSC$K_CLASS_S:
printf("Class S\n");
break;
case DSC$K_CLASS_VS:
printf("Class VS\n");
break;
case DSC$K_CLASS_D:
printf("Class D\n");
break;
default:
printf("Unknown class\n");
break;
}
} $ bas f
$ bas b
$ link f + b + x
$ run f
Class S
|ABC|
Class S
|ABC|

Arne

Re: VMS Basic strings class D vs class S

<urnggb$3trjg$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33628&group=comp.os.vms#33628

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Wed, 28 Feb 2024 09:38:03 -0500
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <urnggb$3trjg$1@dont-email.me>
References: <urgbne$22p1o$1@dont-email.me> <uriv4c$2oiol$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 28 Feb 2024 14:38:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3a6403d1a4c4c2051fbb57ee89a4bfc0";
logging-data="4124272"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iAfX0p9Eq+HZJ1piVGuNb435yvfUlBEA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rHl7TU6+1oYbia25RfbxOYMJiGA=
Content-Language: en-US
In-Reply-To: <uriv4c$2oiol$1@dont-email.me>
 by: Arne Vajhøj - Wed, 28 Feb 2024 14:38 UTC

On 2/26/2024 4:17 PM, Stephen Hoffman wrote:
> On 2024-02-25 21:33:33 +0000, Arne Vajhøj said:
>
>> If I have understood it correctly then VMS Basic strings use class D
>> descriptors.
>>
>> That is very nice.
>>
>> But what happens if non-Basic code call Basic code with a string using
>> a class S descriptor? For input/read? For output/write?
>>
>> Does the Basic runtime call some STR$ function that understands the
>> difference between S and D and handle A properly? Or will I get a
>> runtime error due to invalid string?
>
> "It depends."
>
> Most everything in most of the traditional languages and in the RTLs
> does the right thing with both dynamic and static text strings, though
> the app code involved might not. BASIC app code works pretty well here,
> absent "heroic" efforts by the app developer.
>
> If the app code assumes a dynamic arriving and gets handed static, the
> RTL will either copy it, or space-pad the results into the static, or
> the RTL will return a string truncation error. BASIC space-pads into
> static string buffers if and as needed. Or truncates with an error.

> Apps expecting to work with dynamic descriptors might fail with the
> truncation error as mentioned, and apps expecting to massage static
> descriptors directly and not coded sufficiently cautiously around any
> arriving dynamic strings can fail with heap and other errors.

Basic cannot stuff 200 bytes into a 100 bytes fixed length string. That
is fair.

> it wouldn't surprise me to learn that BASIC will fail to work correctly
> with 64-bit string descriptors, though. Lots of home-grown app code also
> won't.

I sort of get the impression that using 64 bit descriptors is like
doing a bungee jump.

:-)

> I also wouldn't expect the RTLs to work with encodings other than
> ASCII and DEC MCS, either. And UTF-8 will fail in the expected places,
> and most searching and sorting tends not to be sensitive to the
> (written) language used within the text string.

I would assume that it works as long as the string is considered
a sequence of bytes not a sequence of characters.

Arne

Re: VMS Basic strings class D vs class S

<urnhjk$9d4$1@panix2.panix.com>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33629&group=comp.os.vms#33629

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix2.panix.com!panix2.panix.com!not-for-mail
From: kludge@panix.com (Scott Dorsey)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: 28 Feb 2024 14:56:52 -0000
Organization: Former users of Netcom shell (1989-2000)
Lines: 42
Message-ID: <urnhjk$9d4$1@panix2.panix.com>
References: <urgbne$22p1o$1@dont-email.me> <uriv4c$2oiol$1@dont-email.me> <urnggb$3trjg$1@dont-email.me>
Injection-Info: reader1.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="12271"; mail-complaints-to="abuse@panix.com"
 by: Scott Dorsey - Wed, 28 Feb 2024 14:56 UTC

In article <urnggb$3trjg$1@dont-email.me>,
=?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>On 2/26/2024 4:17 PM, Stephen Hoffman wrote:
>> On 2024-02-25 21:33:33 +0000, Arne Vajhøj said:
>>
>>> If I have understood it correctly then VMS Basic strings use class D
>>> descriptors.
>>>
>>> That is very nice.
>>>
>>> But what happens if non-Basic code call Basic code with a string using
>>> a class S descriptor? For input/read? For output/write?
>>>
>>> Does the Basic runtime call some STR$ function that understands the
>>> difference between S and D and handle A properly? Or will I get a
>>> runtime error due to invalid string?
>>
>> "It depends."
>>
>> Most everything in most of the traditional languages and in the RTLs
>> does the right thing with both dynamic and static text strings, though
>> the app code involved might not. BASIC app code works pretty well here,
>> absent "heroic" efforts by the app developer.
>>
>> If the app code assumes a dynamic arriving and gets handed static, the
>> RTL will either copy it, or space-pad the results into the static, or
>> the RTL will return a string truncation error. BASIC space-pads into
>> static string buffers if and as needed. Or truncates with an error.
>
> > Apps expecting to work with dynamic descriptors might fail with the
> > truncation error as mentioned, and apps expecting to massage static
> > descriptors directly and not coded sufficiently cautiously around any
> > arriving dynamic strings can fail with heap and other errors.
>
>Basic cannot stuff 200 bytes into a 100 bytes fixed length string. That
>is fair.

Fortran can! And you likely won't notice that you have damaged some other
memory until you get a SIGSEGV in some totally unrelated part of your code.
--scott
--
"C'est un Nagra. C'est suisse, et tres, tres precis."

Re: VMS Basic strings class D vs class S

<urnjak$3ufab$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33630&group=comp.os.vms#33630

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Wed, 28 Feb 2024 10:26:12 -0500
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <urnjak$3ufab$1@dont-email.me>
References: <urgbne$22p1o$1@dont-email.me> <uriv4c$2oiol$1@dont-email.me>
<urnggb$3trjg$1@dont-email.me> <urnhjk$9d4$1@panix2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 28 Feb 2024 15:26:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="3a6403d1a4c4c2051fbb57ee89a4bfc0";
logging-data="4144459"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+8/4K3ZKq91vNUikGi7y19q8j85knSuQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ve+g/Ye0HYXCWT2vpQdHmdSaduo=
Content-Language: en-US
In-Reply-To: <urnhjk$9d4$1@panix2.panix.com>
 by: Arne Vajhøj - Wed, 28 Feb 2024 15:26 UTC

On 2/28/2024 9:56 AM, Scott Dorsey wrote:
> In article <urnggb$3trjg$1@dont-email.me>,
> =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> wrote:
>> On 2/26/2024 4:17 PM, Stephen Hoffman wrote:
>>> If the app code assumes a dynamic arriving and gets handed static, the
>>> RTL will either copy it, or space-pad the results into the static, or
>>> the RTL will return a string truncation error. BASIC space-pads into
>>> static string buffers if and as needed. Or truncates with an error.
>>
>>> Apps expecting to work with dynamic descriptors might fail with the
>>> truncation error as mentioned, and apps expecting to massage static
>>> descriptors directly and not coded sufficiently cautiously around any
>>> arriving dynamic strings can fail with heap and other errors.
>>
>> Basic cannot stuff 200 bytes into a 100 bytes fixed length string. That
>> is fair.
>
> Fortran can! And you likely won't notice that you have damaged some other
> memory until you get a SIGSEGV in some totally unrelated part of your code.

:-)

Note that VMS Fortran need to be actively mislead to do this.

$ type bufovr.for
program bufovr
character*4 s1, s2
common /b/s1,s2
write(*,*) %loc(s1), %loc(s2)
s2 = 'XXXX'
call subbo1(s1)
write(*,*) s1//s2
call subbo2(s1)
write(*,*) s1//s2
end
c subroutine subbo1(s)
character*(*) s
s = 'ABCDEFGH'
end
c subroutine subbo2(s)
character*8 s
s = '12345678'
end
$ for bufovr
$ link bufovr
$ run bufovr
196608 196612
ABCDXXXX
12345678

Arne

Re: VMS Basic strings class D vs class S

<usav4t$m43h$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33671&group=comp.os.vms#33671

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: seaohveh@hoffmanlabs.invalid (Stephen Hoffman)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Wed, 6 Mar 2024 18:44:29 -0500
Organization: HoffmanLabs LLC
Lines: 31
Message-ID: <usav4t$m43h$1@dont-email.me>
References: <uriv4c$2oiol$1@dont-email.me> <urnggb$3trjg$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="1d4a548faefb44779aefa621404ca03f";
logging-data="725105"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19m6xVbjxGv6UDObRjtjtBsaetVITo1LCA="
User-Agent: Unison/2.2
Cancel-Lock: sha1:pUh3tEaWGgGoQD9R2eW4Ua9k8Xk=
 by: Stephen Hoffman - Wed, 6 Mar 2024 23:44 UTC

On 2024-02-28 14:38:03 +0000, Arne Vajhøj said:

> On 2/26/2024 4:17 PM, Stephen Hoffman wrote:
>
>> I also wouldn't expect the RTLs to work with encodings other than ASCII
>> and DEC MCS, either. And UTF-8 will fail in the expected places, and
>> most searching and sorting tends not to be sensitive to the (written)
>> language used within the text string.
>
> I would assume that it works as long as the string is considered a
> sequence of bytes not a sequence of characters.

The assumption that one byte is one character is embedded deeply in
OpenVMS system and app code and APIs.

I would assume that such code will break in various ways when presented
with UTF-8.

Anything assuming a correspondence between string length and displayed
width is going to fail, for instance.

That's before discussing sorting and searching and language
differences, as was mentioned. And normalization.

OpenVMS has (had) support some of those differences with NCS and with
ICU, though those APIs aren't (weren't) widely used by apps.

--
Pure Personal Opinion | HoffmanLabs LLC

Re: VMS Basic strings class D vs class S

<use0v6$1garj$1@dont-email.me>

  copy mid

https://news.novabbs.org/computers/article-flat.php?id=33685&group=comp.os.vms#33685

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.vms
Subject: Re: VMS Basic strings class D vs class S
Date: Fri, 8 Mar 2024 03:33:58 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <use0v6$1garj$1@dont-email.me>
References: <uriv4c$2oiol$1@dont-email.me> <urnggb$3trjg$1@dont-email.me>
<usav4t$m43h$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 8 Mar 2024 03:33:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d5f167ea8e6b66fd37103ff38661b22f";
logging-data="1583987"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aZyLAmyClgrdA8sa1QGww"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:CZVJm3fQ1cOgeo1BO4FUrQUa9Go=
 by: Lawrence D'Oliv - Fri, 8 Mar 2024 03:33 UTC

On Wed, 6 Mar 2024 18:44:29 -0500, Stephen Hoffman wrote:

> I would assume that such code will break in various ways when presented
> with UTF-8.

Could be worse. Imagine if you had adopted Unicode at exactly that period
in the early 1990s, like Windows NT and Java did, when it was still
supposed to be a fixed-length 16-bit code. Then you would be saddled with
that albatross known as UTF-16.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor