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)
-
19:36
Fit'n Fire
7 hours ago $0.98 earnedThis AK Has a Terrible Reputation -- Here's What Happened
17.4K4 -
17:03
TOMSTC
3 days ago $0.58 earnedDJI Neo 2 Follow Test… Then It Crashed!
15.4K3 -
2:18
Memology 101
1 day ago $0.73 earnedTHIS IS F*CKING CRAZY...
12.5K48 -
31:15
cyphertank
3 days agoCYPHER TANK S01E01
173K12 -
3:04:16
Game On!
21 hours ago $26.28 earnedNFL Wiseguy Roundtable: Rankings The Top 25 Super Bowls From This Century!
218K13 -
21:11
Actual Justice Warrior
1 day agoActivist Wants To BAN Body Cameras For EXPOSING BLM HOAXES
59.5K152 -
14:00
DeVory Darkins
1 day agomayhem erupts with anti-ice agitators storming cities across the country
80.7K151 -
11:59
stateofdaniel
1 day agoBreaking Bad's Gus Fring Actor Calls for Revolution: "They Can't Take Us All Down" – Epic Fail!
58.1K98 -
12:19
Clintonjaws
1 day ago $19.84 earnedLA Mayor Has A Melt Down Live On-Air As She Crumbles Over Don Lemon
99.6K173 -
9:59
Tactical Advisor
1 day agoBest Gun of 2026 | Rideout Arsenal Dragon
66.2K23