Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whats better to SHARED or not
#4
If you want to use Subs and Functions in other programs don't Share and don't Const their variables.

I had a routine that used P2 Const for _Pi(2) that I have to fix in every program not setup with that const.
It's really nice to plug-in with Copy/Paste a routine that's already been tested in another program. It saves time for focus on the current program's needs.

Another consideration is that QB64 does not ByVal the varaibles passed through routines, so there is always a risk of accidently unintentionally changing a variables value in calling module. You can also wonder which is better a GoSub or a Routine call without parameters to pass. So if you consider Sharing a bunch of stuff, consider GoSub instead.
b = b + ...
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



Users browsing this thread: 1 Guest(s)