Hosted by Dailymotion. For legal issues report at the Copyright Center, report us on DMC, or use the Instant Removal tool.
EasyLanguage Tutorial 196 | Scope in methods (plus convert a function to a method) | Part 2
Description
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)
See https://markplex.com/free-tutorials/tutorial-196-scope-in-methods-plus-convert-a-function-to-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)
See https://markplex.com/free-tutorials/tutorial-196-scope-in-methods-plus-convert-a-function-to-a-method/
More from User
06:04
Program 90 | Finding extreme oscillator 'hooks'
Markplex
07:57
Tutorial216
Markplex
09:17
Tutorial217
Markplex
08:33
Tutorial 215 | Alert when MACD crosses a line drawn on chart
Markplex
09:21
Tutorial 214 | Draw a rectangle between the high and low of the week
Markplex
09:43
Tutorial 212 | Draw a rectangle on a chart each day between the high and low of the PREVIOUS day
Markplex
Related Videos
19:01
C# Tutorial In Urdu - Split large method/Function into small methods/functions (Video 2)
ProgramInUrdu
03:37
Learn Java Tutorial 1.16- Java Math Class Functions & Methods
mybringback
00:12
PHP tutorials in urdu - hindi - 42 - use isset function with get and post methods
InfoVideo
26:37
C# Tutorial In Urdu - Basics of C# Methods/Functions (Video 1)
ProgramInUrdu
04:46
Tutorial 205 | How to convert tutorial 23 (line break) and tutorial 173 (supertrend) into functions
Markplex
03:58
Tutorial 205 Part 2 | Converting tutorial 173 to a function
Markplex