[Info-vax] VAX BASIC global variables.

Dave Froble davef at tsoft-inc.com
Fri Oct 15 15:10:06 EDT 2021


On 10/15/2021 1:40 PM, Simon Clubley wrote:
> On 2021-10-15, Arne Vajhøj <arne at vajhoej.dk> wrote:
>> On 10/15/2021 12:09 PM, E Thump wrote:
>>> On Friday, October 15, 2021 at 4:44:49 PM UTC+1, Jeffrey H. Coffield
>>> wrote:
>>>> COMMON (MY_DATA) INTEGER a,b
>>
>>>> sub adder (integer c,integer d)
>>
>>> Next question to do with arrays. Instead of doing DIM Z(10) it seems
>>> I should do COMMON (MY_DATA) INTEGER Z(10) and then use that exact
>>> same line within the sub. The 10 and everything has to match. Am I on
>>> the right lines there?
>>
>> Yes.
>>
>> Declarations *should* match.
>>
>> They are not strictly required to, but it becomes
>> pretty messy if they don't.
>>
>> This does not look good:
>>
>> program hack
>> common (mydata) long a(2)
>
> Yuck. :-)
>
> Common belongs back in the Fortran IV days. Please tell me that DEC Basic
> supports user-defined record data types and that you can pass references
> to instances of those data types around as subroutine parameters. :-)

Yes, as I just mentioned elsewhere.  I really like it, and use it whenever appropriate.

The RECORD statement.

RECORD SIMON
	Long	A%
	String	B$
END RECORD

DIM SIMON Dave(5)

And now Dave(0)::A% is the address of the structure.


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