Premium Only Content

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)
-
34:27
The Quiet Part
5 hours ago $0.21 earnedCanada DIDN'T EVEN TRY!
4.95K4 -
LIVE
SportsPicks
5 hours agoCrick's Corner: Episode 80
42 watching -
2:06:51
The Charlie Kirk Show
3 hours agoVice President JD Vance Remembers Charlie Kirk | Miller, Tucker, RFK Jr., Wiles, Leavitt | 9.15.25
1.39M1.21K -
LIVE
Major League Fishing
5 days agoLIVE! - Fishing Clash Team Series: Heritage Cup - Day 2
316 watching -
1:08:54
Simply Bitcoin
4 hours ago $0.82 earnedNEW REPORT SUGGESTS THE BITCOIN SUPPLY SHOCK IS ACCELERATING?! | EP 1332
21.2K1 -
10:31
Dr. Eric Berg
4 hours ago13 Foods You Should Never Buy Organic
79.2K20 -
15:10
SB Mowing
1 month agoShe had TEARS OF JOY on her face - An update on Beth
60.6K35 -
LIVE
Lofi Girl
3 years agolofi hip hop radio 📚 - beats to relax/study to
351 watching -
2:15:26
Nikko Ortiz
4 hours agoLIVE - Farm Animals Attack!
217K7 -
9:30
Sugar Spun Run
7 hours ago $1.66 earnedBlack and White Cookies
119K2