Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Option _Explicit Keyword(s) of day XXX:
#24
The thing going on about "x2" in the second example just above is good for programmers who don't want to give outlandish names to variables. With OPTION _EXPLICIT and the DIM SHARED going down for "x2", it's actually being protected in the subprogram by the local "x2". Yes sometimes this could get in the way, but some programmers appreciate something like this. There is nothing to do about it except create a parameter for the subprogram and pass the global "x2" as that parameter. Then the value of global "x2" could be changed or not as you (the programmer) decides.

Be glad we're programming in BASIC and not eg. in Python where it is required to tell the interpreter which variables are global inside a function definition.
Reply


Messages In This Thread
RE: Option _Explicit Keyword(s) of day XXX: - by mnrvovrfc - 06-09-2023, 07:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Keyword of the Day 45: _PIXELSIZE SMcNeill 1 867 01-03-2023, 07:41 PM
Last Post: SpriggsySpriggs

Forum Jump:


Users browsing this thread: