Understanding variable scope


show more Understanding variable scope provides you with in-depth training on Developer. Taught by Barton Poulson as part of the Interactive Data Visualization with Processing show less
please wait ...

Understanding variable scope

In the last movie, I gave you an overview of how to use variables within Processing. Again it's a great thing for saving time in coding for making use of information over and over again. And it's an essential practice for data visualization. In this movie, I want to give some more information about creating variables. The first thing I want to talk about is what's called the scope of a variable, and that is in Processing, a variable is either a local variable or it's a global variable. And I will demonstrate that by getting down to a little example here.

First I'm going to call this one, put its name in there as a comment. Now what I'm going to do it I am going to create something what's called global variables. A global variable is a variable that can be use anywhere in a sketch, even if you have got a million lines of code, that variable can be used anywhere. A local variable is one that has a constrained scope. It can only be used in part of a sketch. For in...

Understanding variable scope
Video duration: 6m 53s 7h 43m Beginner

Viewers:

Understanding variable scope provides you with in-depth training on Developer. Taught by Barton Poulson as part of the Interactive Data Visualization with Processing

Subjects:
Developer IT
Software:
Processing
Author:
please wait ...