[Info-vax] VMS Software Q1 '23 Update
Arne Vajhøj
arne at vajhoej.dk
Thu Jan 26 09:32:51 EST 2023
On 1/26/2023 8:58 AM, Arne Vajhøj wrote:
> On 1/26/2023 2:06 AM, Dave Froble wrote:
>> I can be a little dense, but I fail to see the problem in John's
>> example. If I understand it correctly, each routine defines the same
>> PSECT (I believe each common block has it's own PSECT, a Basic MAP
>> statement I'm rather sure does so) with a different definition. So
>> what? And yes, it might be confusing to some.
>
> I think there are 3 problems:
> A) different definition of the common block in different routines
> B) initialization of the the data in multiple routines
> C) A and B combined in such a way that the initialization partly overlaps
>
> which I consider bad, very bad and disaster.
>
>> And that brings this question. What does:
>>
>> integer*2 :: w1,w2='BBBB'X,w3,w4='BBBB'X
>>
>> do?
>>
>> Does both w1 and w2 get set to BBBB? That is not what the comments
>> indicate?
>
> I think it only initialize w2 (and w4).
>
> I am so old that I use data statement for initialization.
>
> :-)
I do not think the exact same problem can be recreated in
Basic (as far as I can read the documentation then Basic
does not allow static initialization in map's).
But to show something in Basic it is easy to do with
assignment:
program p
map (d) long lw1, long lw2
external sub s1, s2
lw1 = 1
lw2 = 2
call s1
call s2
print lw1, lw2
end program
!
sub s1
map (d) word w1, word w2, word w3, word w4
w2 = 1
w4 = 2
end sub
!
sub s2
map (d) byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7,
byte b8
b4 = 1
b8 = 2
end sub
$ bas p
$ lin p
$ r p
16842753 33685506
Arne
More information about the Info-vax
mailing list