HP OpenVMS Systems

ask the wizard
Content starts here

BASIC programming and symbol scoping?

» close window

The Question is:

Using OpenVMS BASIC v1.4, is it possible to declare functions with local scope
 (in other words, the function is only defined within the context of the
 current function)?
What we'd like to achieve:
   call functionA
   call functionB
End Program1
functionA call function1
functionB call function1
where function1 has the same name/label, but different code.
I am familiar with how to do this in C, but am having trouble doing it in BASIC.

The Answer is :

  This symbol scoping is outside the scope of the BASIC
  programming language; BASIC does not offer module-local
  (static) construct.
  For information on programming BASIC on OpenVMS, please
  see the available BASIC documentation.
  The OpenVMS Wizard would encourage use of unique names and
  symbols, both for BASIC itself and for reasons of software
  support and maintainability.  (The OpenVMS Wizard will
  assume there is a reason why this scoping is of interest,
  though no details where provided -- accordingly, please
  contact the customer support center directly.)

answer written or last revised on ( 26-MAR-2004 )

» close window