EasyLanguage Tutorial 196 | Scope in methods (plus convert a function to a method) | Part 2
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)
-
DVR
In The Litter Box w/ Jewels & Catturd
17 hours agoPatriotism Is Spreading | In the Litter Box w/ Jewels & Catturd - Ep. 560 - 5/3/2024
14.5K9 -
LIVE
Major League Fishing
3 days agoBass Pro Tour LIVE - Stage Three - Day 2
804 watching -
1:31:50
vivafrei
5 hours agoInterview with Norm Pattis - Attorney for Alex Jones, Jan. 6'ers! Life to Lawfare! Viva Frei Live
25K13 -
1:27:03
Steve-O's Wild Ride! Podcast
1 day agoDuncan Trussell Isn't Screwing Around When It Comes To A.I
10.2K5 -
2:42:11
Barstool Yak
5 hours agoThe Yak with Big Cat & Co. Presented by Rhoback | The Yak 5-3-24
17.8K2 -
43:15
TENET Media
3 hours agoShocking Images of UCLA Post-Protest | Dave Rubin & Isabel Brown
8.72K26 -
7:38
America Uncovered
7 hours agoThe Most Dramatic and Terrifying Expansion of US Government Surveillance?
8.64K6 -
1:20:09
Deprogrammed with Keri Smith
2 hours agoHow to Practice Public Speech - LIVE Deprogrammed with Keri Smith
8.39K3 -
59:33
Dr. Eric Berg
1 day agoThe Dr. Berg Show LIVE May 3, 2024
18.2K8 -
1:04:34
John Burk
3 hours agoMan or bear and John Ross returns!
21.8K9