[Info-vax] VMS Basic and quad by value

Dave Froble davef at tsoft-inc.com
Fri Sep 23 21:09:42 EDT 2022


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.

>     print a
>
> end sub
> $ bas z1
>
> sub f(quad a by value)
> ...............^
> %BASIC-E-NOTRECVBY, A may not be received BY VALUE
> at line number 11 in file DISK2:[ARNE.ipc.redis]z1.bas;7
> %BASIC-E-ENDNOOBJ, DISK2:[ARNE.ipc.redis]z1.bas;7 completed with 1 diagnostic -
> object deleted
>
> and the manual says:
>
> <quote>
> You can pass BYTE, WORD, LONG, QUAD, DOUBLE, GFLOAT, SINGLE,
> SFLOAT, and TFLOAT values by value.
> </quote>
>
> This is on Alpha. There would be an obvious problem on VAX.
>
> Arne
>
>
>


-- 
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