DIM SHARED, SHARED and COMMON SHARED Statement?

  • DIM SHARED statement is used to declare global variable in main module.
    • Syntax:
      • DIM SHARED variable
        • Eg: 
          • DIM SHARED A

  • SHARED statement is used to declare global variable in sub module. It is used to make the variable accessible which is declared at the module level without passing them as parameters.
    • Syntax:
      • SHARED variable
        • Eg:
          •  SHARED A

  • The COMMON SHARED is a non executable statement that declares global variables for sharing between modules (main program to sub program or function and vice versa).
  • This statement declares the variable as global so that all modules can use this variable.
    • Syntax: COMMON SHARED variable
      • Example:
        • COMMON SHARED A

Share :

Twitter

Random Posts

Back To Top

facebook main

counter

Powered by Blogger.