[Info-vax] VMS Basic and quad by value
Dave Froble
davef at tsoft-inc.com
Fri Sep 23 21:18:38 EDT 2022
On 9/23/2022 9:09 PM, Dave Froble wrote:
> On 9/23/2022 6:45 PM, Arne Vajhøj wrote:
>> On 9/23/2022 4:45 PM, Bill Gunshannon wrote:
>>> On 9/23/22 16:37, Arne Vajhøj wrote:
>>>> I am not good at Basic so I may be missing something obvious.
>>>>
>>>> As I read the manual then I should be able to pass a quad by value.
>>>>
>>>> But the compiler disagrees.
>>>>
>>>> Can anybody shed some light on this?
>>>>
>>>
>>> Can you show us the code?
>>
>> Sure.
>>
>> $ type z1.bas
>> program z1
>>
>> declare quad v
>>
>> v = 123
>> call f(v)
>
> You do realize, I hope, that you are passing the variable by reference?
>
>> end program
>> !
>>
>> sub f(quad a by value)
>
> I tried this. It appears that Basic does not allow an argument to be declared
> QUAD and received By Value. I'd consider this a bug.
>
> However, to demonstrate:
>
> AS800> t z5.bas,z6.bas
> 1 ! Program Z5
>
> Declare Quad Q
>
> Q = 123
> Call Z6( Q )
> Print Q
>
> End
>
> SYS$SYSDEVICE:[DFE]Z6.BAS;4
>
> 1 ! Program Z6
>
> Sub Z6( Long L By Value )
>
> Print L
>
> End Sub
> AS800> run z5
> 2061851336
> 123
> AS800>
>
> As expected, the value of the argument is the address of the quadword variable
> in program Z5.
>
>>
>> This is on Alpha. There would be an obvious problem on VAX.
As a follow up, my test was using Alpha BASIC V1.7-000
I believe there are later versions of Basic.
I tried the test on VAX, and the Basic on the VAX, VAX BASIC V3.8-000, didn't
seem to like Quad data types. As expected.
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list