EasyLanguage Tutorial 196 | Scope in methods (plus convert a function to a method) | Part 1
Tutorial 196 gives an example of “scope” in the context of a method.
A common guideline in good programming practice suggests that a method should ideally only utilize variables that are provided through its parameter list or those that are locally declared within the method itself. However, there are situations where adhering strictly to this principle might be overly cumbersome or impractical. In such cases, it becomes possible to reference variables that have been declared at a the EasyLanguage study level.
Both “types” of methods are demonstrated in this tutorial.
When a variable is declared within the primary section of a study, it can be directly accessed and modified throughout that study. Nevertheless, when a method is invoked, it operates within its designated scope by design. This means that a variable declared within a method is confined to that method’s scope. Even if a variable with an identical name exists elsewhere, it is treated as a distinct and separate entity, maintaining its own distinct scope within the method.
To demonstrate converting the functions to methods two functions are used:
XAverage (a series function), and
Average( a simple function)
-
LIVE
Talk Nerdy 2 Us
1 hour ago🚨Cyber Siege: From White House Scandals to Global Cyber Threats 🚨
1,641 watching -
26:49
Alexis Wilkins
8 hours agoBetween the Headlines with Alexis Wilkins: Michael Cohen on Tik Tok, Free Speech, AR Lectern, FDNY
4.89K10 -
1:53:34
Fresh and Fit
20 hours agoSulaiman Ahmed And Destiny Debate Israel Palestine Conflict!
120K208 -
1:35:13
Roseanne Barr
6 hours agoGuns And Chardonnay | The Roseanne Barr Podcast #46
34K69 -
58:25
The StoneZONE with Roger Stone
4 hours agoWill America’s Population Die? Is America Caught In A Death Spiral? Kevin Dolan Enters The StoneZONE
21K9 -
1:21:14
Glenn Greenwald
6 hours agoPost-9/11 "Terrorism" Hysteria Returns With a Vengeance | SYSTEM UPDATE #266
45.4K162 -
1:09:36
Tucker Carlson
4 hours agoAdvice to Men: Reject Sex, Parties, and Fame. Embrace God Instead.
86.4K94 -
2:39:51
ZeroHedge
5 hours agoThe Great Crypto Vs Gold Debate
23.3K13 -
2:14:33
The Quartering
11 hours agoThe Heartbreaking State Of Men! w/ Better Bachelor
53K48 -
1:07:48
Edge of Wonder
6 hours agoCIA Docs About Vampires, Alien Encounters, Antarctica & More Weird News
28.2K10