Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whats better to SHARED or not
#2
Standard's for Good Code always recommend minimizing or eliminating Global variables.

   That being said I find Global variables (Common or Dim Shared) to be useful especially if you want to use a value throughout your code.    But keeping as many variables possible local to subs is also desired.   It's almost a necessity if you want to use any kind of recursion (a sub or function calling itself).   

    I always say do what works.   I personally recommend using Global variables sparingly (a rule I sometimes break myself).   But if it works then it works.
Reply


Messages In This Thread
Whats better to SHARED or not - by doppler - 11-07-2024, 04:23 PM
RE: Whats better to SHARED or not - by ahenry3068 - 11-07-2024, 04:29 PM
RE: Whats better to SHARED or not - by bplus - 11-07-2024, 05:02 PM
RE: Whats better to SHARED or not - by madscijr - 11-07-2024, 10:01 PM
RE: Whats better to SHARED or not - by doppler - 11-07-2024, 08:04 PM
RE: Whats better to SHARED or not - by madscijr - 11-07-2024, 10:13 PM
RE: Whats better to SHARED or not - by doppler - 11-08-2024, 03:10 AM
RE: Whats better to SHARED or not - by bplus - 11-07-2024, 11:39 PM
RE: Whats better to SHARED or not - by bplus - 11-07-2024, 11:44 PM
RE: Whats better to SHARED or not - by vince - 11-08-2024, 06:39 AM
RE: Whats better to SHARED or not - by madscijr - 11-10-2024, 06:13 PM
RE: Whats better to SHARED or not - by Pete - 11-08-2024, 06:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Whats the difference between a Utility and a Program bplus 20 1,580 01-18-2026, 06:51 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)