[Info-vax] VAX BASIC global variables.

Dave Froble davef at tsoft-inc.com
Fri Oct 15 15:01:26 EDT 2021


On 10/15/2021 12:09 PM, E Thump wrote:
  
> Cheers, yeah I went back to Arne's initial suggestion and am backfilling my program accordingly.
>
> 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?
>
> Appreciate the help guys!
>

Is there some reason you're wanting global variables?  Yes, they can be useful, but there
are other methods to pass variables between programs.

As Jeff mentioned, COMMON and MAP are the methods to have global data, and, they must be
defined everywhere referenced.  Both are set up as a PSECT.  The linker aligns them.  I won't
get into having different definitions of the structure.  That can get interesting.

You can pass an array to a subprogram or function.  After all, parameters are just an address
or a value.

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