Premium Only Content
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)
-
9:49
Tundra Tactical
8 hours ago $13.14 earnedThe Best Tundra Clips from 2024 Part 1.
76.9K7 -
1:05:19
Sarah Westall
8 hours agoDying to Be Thin: Ozempic & Obesity, Shedding Massive Weight Safely Using GLP-1 Receptors, Dr. Kazer
70.5K19 -
54:38
LFA TV
1 day agoThe Resistance Is Gone | Trumpet Daily 12.26.24 7PM EST
51.7K9 -
58:14
theDaily302
17 hours agoThe Daily 302- Tim Ballard
52.8K2 -
13:22
Stephen Gardner
11 hours ago🔥You'll NEVER Believe what Trump wants NOW!!
102K233 -
54:56
Digital Social Hour
1 day ago $10.51 earnedDOGE, Deep State, Drones & Charlie Kirk | Donald Trump Jr.
56.4K5 -
DVR
The Trish Regan Show
12 hours agoTrump‘s FCC Targets Disney CEO Bob Iger Over ABC News Alleged Misconduct
61.7K37 -
1:48:19
The Quartering
13 hours agoElon Calls White People Dumb, Vivek Calls American's Lazy & Why Modern Christmas Movies Suck!
143K112 -
2:08:42
The Dilley Show
14 hours ago $36.74 earnedH1B Visa Debate, Culture and More! w/Author Brenden Dilley 12/26/2024
123K41 -
4:55:59
LumpyPotatoX2
16 hours agoThirsty Thursday on BOX Day - #RumbleGaming
113K7