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)
- 	
				 1:04:43 1:04:43Crypto Power Hour13 hours ago $5.98 earnedCrypto Price Swings Explained — What Every Investor Needs to Know31.7K7
- 	
				 21:31 21:31Clownfish TV22 hours agoOG YouTube is Officially ENDING! Employees Offered BUYOUTS?! | Clownfish TV13.5K28
- 	
				 5:54 5:54Gun Owners Of America20 hours agoThe Virginia Election Could Shift The Balance of Power Nationwide20.6K5
- 	
				 2:00:02 2:00:02BEK TV1 day agoTrent Loos in the Morning - 10/31/202515.7K1
- 	
				 4:05:45 4:05:45The Bubba Army1 day agoIs Killing The New Trend??! - Bubba the Love Sponge® Show | 10/31/2551.3K2
- 	
				 2:25:16 2:25:16Demons Row15 hours ago $6.00 earnedEx Hells Angels MC President: Charles “Peewee”Goldsmith (Full Interview)22.4K4
- 	
				 3:35 3:35Gamazda13 hours ago $6.88 earnedThe Darkest Piano Theme?33.3K39
- 	
				 13:42 13:42Nate The Lawyer21 hours ago $5.49 earnedINSANE Judge REMOVED For Lying Under Oath, Insurance Fraud & Stolen Valor26.3K16
- 	
				 38:32 38:32Code Blue Cam1 day agoHow Police Stopped a Potential Church Massacre...54.8K13
- 	
				 24:26 24:26Actual Justice Warrior1 day agoWelfare Queens RAGE OUT Over Food Stamp Cuts23.9K63