154 Defining the Scope of a Variable Now if the sales tax changes from 0.075 to 0.080, you just need to change this value in one constant declaration, such as Const sales_tax as Single = 0.080 This one change effectively plugs in the value of 0.080 everywhere your program uses the sales_tax constant. So constants offer two advantages: ✦ They let you replace fixed values with descriptive constant names. ✦ They let you change the value of a constant once and have those changes occur automatically in the rest of your program. So use constants to replace fixed values and use variables to store different types of data retrieved from the outside world. Every program needs to use variables, but not every program needs to use constants. After you understand how to store data temporarily in variables, your program can start manipulating that data to do something useful. Defining the Scope of a Variable The scope of a variable defines which part of your program can store and retrieve data in a variable. Because variables store data that your program needs to work correctly, your program must make sure that no other part of the program accidentally modifies that data. If your program stores a person’s credit card number in a variable, you don’t want another part of your program to accidentally retrieve that data and change the numbers around or send a hundred copies of each credit card number to customers outside the company. So when creating variables, limit the variables’ scope. The scope simply defines which parts of your program can access a variable. When you declare a variable, you also define one of three possible scope levels for that variable: ✦ Global ✦ Module ✦ Subprogram Handling global variables with care In a global variable, any part of your program can access that variable, including storing new data in that variable (and wiping out any existing data already stored in that variable), changing the data in a variable, or wiping out the data in a variable altogether, as shown in Figure 2-5.
Defining the Scope of a Variable 155 Program File 1 File 2 Global X : integer Book II Chapter 2 Figure 2-5: Every part of a program can access and change a global variable. File 3 File 4 Variables, Data Types, and Constants Use global variables sparingly. If you create a global variable and some part of your program keeps modifying that variable’s data by mistake, you have to search through your entire program to find which command is messing up that variable. If you have a million-line program, guess what? You have to examine a million lines of code to find the one line that’s changing that variable by mistake. If that’s your idea of fun, go ahead and use global variables. In the old days, all programming languages let you create global variables, and it was up to the programmer to make sure no commands accidentally modified that variable in unintended ways. When writing small programs, programmers can do this easily, but when working on massive programs created by teams of programmers, the odds of abusing global variables increases dramatically. Think of a shelf where you can store your books, wallet, and laptop computer. If you’re the only person who has access to that shelf, you can be sure anything you put on that shelf is there when you look for it again. Now imagine putting your shelf of personal belongings (books, wallet, and laptop computer) on a shelf located in Grand Central Station where thousands of people can grab anything they want off that shelf or put something
Agreed in 2016, the motive of the General Data Protection Regulation (GDPR) is to better protect the personal data of European Union “data subjects” – EU citizens and other nationals physically present in the EU at the time data are collected. Visit: https://www.hipaajournal.com/gdpr-training/
The Health Insurance Portability and Accountability Act (HIPAA) was created primarily to modernize the flow of healthcare information, stipulate how Personally Identifiable Information maintained by the healthcare and healthcare insurance industries should be protected from fraud and theft, and address limitations on healthcare insurance coverage – such as portability and the coverage of individuals with pre-existing conditions.